home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
PERL30X.ZIP
/
OS2.PL
< prev
next >
Wrap
Text File
|
1991-01-14
|
890b
|
28 lines
extproc C:\binp\misc\perl.exe -S
#!perl
# Process ID.
print "This process ID is $$ and its parent's ID is ",
getppid(), "\n\n";
# Priority.
printf "Current priority is %x\n", getpriority(0,0);
print "Changing priority by +5\n";
print "Failed!\n" unless setpriority(0,0,+5);
printf "Priority is now %x\n\n", getpriority(0,0);
# Pipes. Unlike MS-DOS, OS/2 supports true asynchronous pipes.
open(ROT13, '|perl -pe y/a-zA-Z/n-za-mN-ZA-M/') || die;
select(ROT13); $|=1; select(STDOUT);
print "Type two lines of stuff, and I'll ROT13 it while you wait.\n".
"If you type fast, you might be able to type both of your\n".
"lines before I get a chance to translate the first line.\n";
$_ = <STDIN>; print ROT13 $_;
$_ = <STDIN>; print ROT13 $_;
close(ROT13);
print "Thanks.\n\n";
# I won't bother with the other stuff. You get the idea.