home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5296 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.6 KB

  1. Path: sparky!uunet!mcsun!uknet!icdoc!dds
  2. From: dds@doc.ic.ac.uk (Diomidis D Spinellis)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: #! Emulation in MSDOS
  5. Message-ID: <1992Aug13.132107.24139@doc.ic.ac.uk>
  6. Date: 13 Aug 92 13:21:07 GMT
  7. References: <1992Aug13.044323.1094@silogic.uucp>
  8. Sender: usenet@doc.ic.ac.uk
  9. Organization: Department of Computing, Imperial College, University of London, UK.
  10. Lines: 24
  11. Nntp-Posting-Host: swan.doc.ic.ac.uk
  12.  
  13. In article <1992Aug13.044323.1094@silogic.uucp> markd@silogic.uucp (Mark C. DiVecchio (K3FWT)) writes:
  14. >In a recent posting, I saw a reference to #! emulation in MSDOS.  The
  15. >posting showed a code fragment which was to be place at the front of the
  16. >file:
  17. >@REM=(qq!
  18. >@echo off
  19. >perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  20. >@goto end :) if 0;
  21. >After trying this, it became obvious that a line or two is required at
  22. >the end of the file after the Perl code.  I'm not versed enough in Perl
  23. >to figure out the lines at the end. 
  24.  
  25. You do not need any code at the end of the script, if you modify the @goto end
  26. command to read just @end.  Then add an empty file in your path named end.bat.
  27. When MS-DOS invokes a batch file from within another batch file, the code
  28. behaves like a jump, not a call i.e. after the second batch file terminates
  29. control will _not_ return to the original, invoking, batch file.  Thus then
  30. empty end.bat batch file effectively adds a command to terminate batch files
  31. to your system.
  32.  
  33. Diomidis
  34. -- 
  35. Diomidis Spinellis    Internet: <dds@doc.ic.ac.uk>  UUCP: ...!uknet!icdoc!dds
  36. Department of Computing, Imperial College, London SW7     #include "/dev/tty"
  37.