Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!rochester!cornell!uw-beaver!ubc-cs!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.perl Subject: Perl Script Idiom for DOS batch files. Message-ID: <475@oha.UUCP> Date: 6 Mar 91 16:59:06 GMT References: <1991Mar1.041441.4810@ccu1.aukuni.ac.nz> <1991Mar4.165742.12909@holos0.uucp> Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada. Lines: 26 In-Reply-To: Message <1991Mar4.165742.12909@holos0.uucp> dated 4 Mar 91 16:57:42 GMT In message <1991Mar4.165742.12909@holos0.uucp>, lbr@holos0.uucp (Len Reed) writes: > > In article <1991Mar1.041441.4810@ccu1.aukuni.ac.nz> russell@ccu1.aukuni.ac.nz > (Russell J Fulton) writes: > > > Is there and equivalent of #!.../perl for MS dos .bat files? > > I could not find a general solution to this problem. Ok. First, create a copy of perl.exe called #.exe. Second, create an empty file called $$.bat. Now, your .bat/perl code looks like... # %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 $$ ; Your Perl Code Here At least, this works under DOS 3.2. It relies on the non-nesting nature of your script.bat and $$.bat files. -- Yours etc., Tony Olekshy. Internet: tony%oha@CS.UAlberta.CA BITNET: tony%oha.uucp@UALTAMTS.BITNET uucp: alberta!oha!tony Nothing does more hurt in a state than that cunning men pass for wise. --Bacon