home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / perl / 7732 < prev    next >
Encoding:
Internet Message Format  |  1993-01-09  |  2.3 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: <1272@alsys1.aecom.yu.edu>
  6. Date: 10 Jan 93 03:50:18 GMT
  7. References: <1993Jan8.071450.7631@netcom.com> <1270@alsys1.aecom.yu.edu> <1993Jan8.220106.10383@netcom.com>
  8. Sender: news@alsys1.aecom.yu.edu
  9. Organization: School of Engineering and Applied Sciences, UCLA
  10. Lines: 46
  11. Nntp-Posting-Host: yu1.yu.edu
  12.  
  13. In article <1993Jan8.220106.10383@netcom.com> jfh@netcom.com (Jack Hamilton) writes:
  14. >>>1  >>    @rem = '                   
  15. >>>2  >>    some dos batch commands
  16. >>>3  >>    PERL -S %0.BAT %1 %2 %3 (etc)
  17. >>>4  >>    GOTO ENDOFPERL
  18. >>>5  >>    ';
  19. >>>6  >>    # your perl script here
  20. >>>7  >>    __END__
  21. >>>8  >>    :ENDOFPERL
  22. >>>9  >>    some more DOS if you need it
  23. >>>10 >>    rem Drop through end of Batch file
  24.  
  25. >>Why does Perl skip over the GOTO?
  26. >
  27. >Because it's inside a quoted string, the one which starts on line 1 and
  28. >ends on line 5.  As far as perl is concerned, it's not a statement.
  29.  
  30. Right, that should have been obvious.
  31.  
  32. >>How does the expansion of the %0-%9 parameters work? Apparently
  33. >>this is done twice, once in the batch processor and again in the
  34. >>Perl processor. Is that right? Thus which meta characters must be
  35. >>escaped and Once or twice?
  36. >
  37. >The parameters are expanded only by DOS.  They're inside single quotes and
  38. >not expanded.  And even if they were, they'd still be inside a string, so
  39. >nothing would happen. 
  40.  
  41. I am still very confised on this one. If my batch file is named
  42. "howdy" and my DOS command line is: Howdy firstname lastname, then
  43. firstname gets passed to %1 and lastname gets passed to %2. Then,
  44. when Perl is activated it passes %1 and %2 to @ARGV. Where do the
  45. single quotes youtalk about come into the picture? Also if  there
  46. were no single quotes (no matter where they come from) would Perl
  47. then do an expansion as well?
  48.  
  49.  
  50. -- 
  51. ***************************************************************************
  52.     Henry Manaster          *     EMail: manaster@yu1.yu.edu
  53.     Brooklyn, NY            *
  54.                                 *
  55.     Disclaimer: The above is not necessarily MY opinion nor that 
  56.                 of anyone else :-)  ????!
  57. ****************************************************************************
  58.  
  59.