home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / PERL30X.ZIP / PERLSH.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-14  |  437b  |  20 lines

  1. extproc perl -x
  2. #!perl
  3.  
  4. # Poor man's perl shell.
  5.  
  6. # Simply type two carriage returns every time you want to evaluate.
  7. # Note that it must be a complete perl statement--don't type double
  8. #  carriage return in the middle of a loop.
  9.  
  10. print "Perl shell\n> ";
  11.  
  12. $/ = '';    # set paragraph mode
  13. $SHlinesep = "\n";
  14.  
  15. while ($SHcmd = <>) {
  16.     $/ = $SHlinesep;
  17.     eval $SHcmd; print $@ || "\n> ";
  18.     $SHlinesep = $/; $/ = '';
  19. }
  20.