home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psinntp!alsys1!yu1.yu.edu!manaster
- From: manaster@yu1.yu.edu (Chaim Manaster)
- Newsgroups: comp.lang.perl
- Subject: Re: How to run a Perl under DOS?
- Message-ID: <1272@alsys1.aecom.yu.edu>
- Date: 10 Jan 93 03:50:18 GMT
- References: <1993Jan8.071450.7631@netcom.com> <1270@alsys1.aecom.yu.edu> <1993Jan8.220106.10383@netcom.com>
- Sender: news@alsys1.aecom.yu.edu
- Organization: School of Engineering and Applied Sciences, UCLA
- Lines: 46
- Nntp-Posting-Host: yu1.yu.edu
-
- In article <1993Jan8.220106.10383@netcom.com> jfh@netcom.com (Jack Hamilton) writes:
- >>>1 >> @rem = '
- >>>2 >> some dos batch commands
- >>>3 >> PERL -S %0.BAT %1 %2 %3 (etc)
- >>>4 >> GOTO ENDOFPERL
- >>>5 >> ';
- >>>6 >> # your perl script here
- >>>7 >> __END__
- >>>8 >> :ENDOFPERL
- >>>9 >> some more DOS if you need it
- >>>10 >> rem Drop through end of Batch file
-
- >>Why does Perl skip over the GOTO?
- >
- >Because it's inside a quoted string, the one which starts on line 1 and
- >ends on line 5. As far as perl is concerned, it's not a statement.
-
- Right, that should have been obvious.
-
- >>How does the expansion of the %0-%9 parameters work? Apparently
- >>this is done twice, once in the batch processor and again in the
- >>Perl processor. Is that right? Thus which meta characters must be
- >>escaped and Once or twice?
- >
- >The parameters are expanded only by DOS. They're inside single quotes and
- >not expanded. And even if they were, they'd still be inside a string, so
- >nothing would happen.
-
- I am still very confised on this one. If my batch file is named
- "howdy" and my DOS command line is: Howdy firstname lastname, then
- firstname gets passed to %1 and lastname gets passed to %2. Then,
- when Perl is activated it passes %1 and %2 to @ARGV. Where do the
- single quotes youtalk about come into the picture? Also if there
- were no single quotes (no matter where they come from) would Perl
- then do an expansion as well?
-
-
- --
- ***************************************************************************
- Henry Manaster * EMail: manaster@yu1.yu.edu
- Brooklyn, NY *
- *
- Disclaimer: The above is not necessarily MY opinion nor that
- of anyone else :-) ????!
- ****************************************************************************
-
-