home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / perl / 7719 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.9 KB

  1. Path: sparky!uunet!psinntp!alsys1!yu1.yu.edu!manaster
  2. From: manaster@yu1.yu.edu (Chaim Manaster)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: How to run a Perl under DOS?
  5. Message-ID: <1270@alsys1.aecom.yu.edu>
  6. Date: 8 Jan 93 16:38:25 GMT
  7. References: <1993Jan7.182209.1931@unipalm.co.uk> <1268@alsys1.aecom.yu.edu> <1993Jan8.071450.7631@netcom.com>
  8. Sender: news@alsys1.aecom.yu.edu
  9. Organization: School of Engineering and Applied Sciences, UCLA
  10. Lines: 67
  11. Nntp-Posting-Host: yu1.yu.edu
  12.  
  13.  
  14. In article <1993Jan8.071450.7631@netcom.com> jfh@netcom.com (Jack Hamilton) writes:
  15. >1  >>    @rem = '                   
  16. >2  >>    some dos batch commands
  17. >3  >>    PERL -S %0.BAT %1 %2 %3 (etc)
  18. >4  >>    GOTO ENDOFPERL
  19. >5  >>    ';
  20. >6  >>    # your perl script here
  21. >7  >>    __END__
  22. >8  >>    :ENDOFPERL
  23. >9  >>    some more DOS if you need it
  24. >10 >>    rem Drop through end of Batch file
  25.  
  26. ...
  27.  
  28. >(3), like (2), is ignored in perl, but calls the perl interpreter in batch.
  29. >The -S options means "search the path for the script".  The "%0" expands to
  30. >the name of the file.  The remaining things are just parameters to be
  31. >passed to perl. 
  32. >
  33. >(4) is ignored in perl, but in DOS it's a GOTO command pointing to (8).
  34. >The contents of (5)-(7) are perl commands, and probably won't be valid DOS
  35. >commands.  The GOTO just skips over them. 
  36.  
  37. Why does Perl skip over the GOTO? That is a valid command in Perl
  38. (even if illadvised). So in effect, both the batch and Perl
  39. processors are interpreting the same file over again. Neat.
  40. How does the expansion of the %0-%9 parameters work? Apparently
  41. this is done twice, once in the batch processor and again in the
  42. Perl processor. Is that right? Thus which meta characters must be
  43. escaped and Once or twice?
  44.  
  45. I put all my batch files in a \bat directory which is on the path,
  46. so the batch processor will find any bat file in it, I suppose I
  47. still need the -s so that Perl will know to search the path as
  48. well?
  49.  
  50. By the way, in all the Perl stuff I have read so far, I keep seeing
  51. references to "globbing", is this just another way of saying
  52. "command line expansion"?
  53.  
  54. >You do something similar using the -x command line  option instead of the -S
  55. >command line option. 
  56.  
  57. What's the difference between the two?
  58.  
  59. Thanks for the help. I thought it was something along these lines,
  60. but the details escaped me. I think I got it now.
  61.  
  62. Henry Manaster
  63.  
  64. P.S. I keep seeing references to "sockets" in the Perl docs. I have
  65. no idea what this means, other than that it doesn't work in the DOS
  66. versions of Perl. I assume it is a unix term. What does this mean
  67. or do?
  68. Thanks again.
  69. HM
  70.  
  71. -- 
  72. ***************************************************************************
  73.     Henry Manaster          *     EMail: manaster@yu1.yu.edu
  74.     Brooklyn, NY            *
  75.                                 *
  76.     Disclaimer: The above is not necessarily MY opinion nor that 
  77.                 of anyone else :-)  ????!
  78. ****************************************************************************
  79.  
  80.