home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / PERL30X.ZIP / OS2.PL < prev    next >
Text File  |  1991-01-14  |  890b  |  28 lines

  1. extproc C:\binp\misc\perl.exe -S
  2. #!perl
  3.  
  4. # Process ID.
  5.     print "This process ID is $$ and its parent's ID is ",
  6.         getppid(), "\n\n";
  7.  
  8. # Priority.
  9.  
  10.     printf "Current priority is %x\n", getpriority(0,0);
  11.     print "Changing priority by +5\n";
  12.     print "Failed!\n" unless setpriority(0,0,+5);
  13.     printf "Priority is now %x\n\n", getpriority(0,0);
  14.  
  15. # Pipes.  Unlike MS-DOS, OS/2 supports true asynchronous pipes.
  16.     open(ROT13, '|perl -pe y/a-zA-Z/n-za-mN-ZA-M/') || die;
  17.     select(ROT13); $|=1; select(STDOUT);
  18.     print "Type two lines of stuff, and I'll ROT13 it while you wait.\n".
  19.           "If you type fast, you might be able to type both of your\n".
  20.           "lines before I get a chance to translate the first line.\n";
  21.     $_ = <STDIN>; print ROT13 $_;
  22.     $_ = <STDIN>; print ROT13 $_;
  23.     close(ROT13);
  24.     print "Thanks.\n\n";
  25.  
  26. # I won't bother with the other stuff.  You get the idea.
  27.  
  28.