home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!gatech!destroyer!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!namao!jboeske
- From: jboeske@namao.uucp (John Boeske)
- Subject: Re: #! Emulation in MSDOS
- Message-ID: <jboeske.713740843@namao>
- Sender: news@kakwa.ucs.ualberta.ca
- Nntp-Posting-Host: namao.ucs.ualberta.ca
- Organization: University Of Alberta, Edmonton Canada
- References: <1992Aug13.044323.1094@silogic.uucp> <1992Aug13.132107.24139@doc.ic.ac.uk>
- Date: Thu, 13 Aug 1992 21:20:43 GMT
- Lines: 33
-
- >In a recent posting, I saw a reference to #! emulation in MSDOS. The
- >posting showed a code fragment which was to be place at the front of the
- >file:
- >@REM=(qq!
- >@echo off
- >perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
- >@goto end :) if 0;
- >After trying this, it became obvious that a line or two is required at
- >the end of the file after the Perl code. I'm not versed enough in Perl
- >to figure out the lines at the end.
-
- I have the following file, _.bat in my path:
- ----------------------- _.bat -----------------------
- @echo off
- if not "%1"=="#" goto EXIT
- shift
- shift
- shift
- perl -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
- :EXIT
-
- and I start my perl scripts with
- ---------------------- hello.bat ---------------------
- @_; # perl %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
- print "JADPH\n";
-
-
- This seems simpler to me, but I can't easily put -w's and the like in
- the perl script. And I haven't yet explicitly put . in my PATH, so I
- have to make sure that my scripts are in my PATH. But I'm happy anyway.
-
- John Boeske System Software, CNS, University of Alberta
- jboeske@namao.ucs.ualberta.ca
-