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: <1270@alsys1.aecom.yu.edu>
- Date: 8 Jan 93 16:38:25 GMT
- References: <1993Jan7.182209.1931@unipalm.co.uk> <1268@alsys1.aecom.yu.edu> <1993Jan8.071450.7631@netcom.com>
- Sender: news@alsys1.aecom.yu.edu
- Organization: School of Engineering and Applied Sciences, UCLA
- Lines: 67
- Nntp-Posting-Host: yu1.yu.edu
-
-
- In article <1993Jan8.071450.7631@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
-
- ...
-
- >(3), like (2), is ignored in perl, but calls the perl interpreter in batch.
- >The -S options means "search the path for the script". The "%0" expands to
- >the name of the file. The remaining things are just parameters to be
- >passed to perl.
- >
- >(4) is ignored in perl, but in DOS it's a GOTO command pointing to (8).
- >The contents of (5)-(7) are perl commands, and probably won't be valid DOS
- >commands. The GOTO just skips over them.
-
- Why does Perl skip over the GOTO? That is a valid command in Perl
- (even if illadvised). So in effect, both the batch and Perl
- processors are interpreting the same file over again. Neat.
- 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?
-
- I put all my batch files in a \bat directory which is on the path,
- so the batch processor will find any bat file in it, I suppose I
- still need the -s so that Perl will know to search the path as
- well?
-
- By the way, in all the Perl stuff I have read so far, I keep seeing
- references to "globbing", is this just another way of saying
- "command line expansion"?
-
- >You do something similar using the -x command line option instead of the -S
- >command line option.
-
- What's the difference between the two?
-
- Thanks for the help. I thought it was something along these lines,
- but the details escaped me. I think I got it now.
-
- Henry Manaster
-
- P.S. I keep seeing references to "sockets" in the Perl docs. I have
- no idea what this means, other than that it doesn't work in the DOS
- versions of Perl. I assume it is a unix term. What does this mean
- or do?
- Thanks again.
- HM
-
- --
- ***************************************************************************
- Henry Manaster * EMail: manaster@yu1.yu.edu
- Brooklyn, NY *
- *
- Disclaimer: The above is not necessarily MY opinion nor that
- of anyone else :-) ????!
- ****************************************************************************
-
-