Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!targon!andre From: andre@targon.UUCP (andre) Newsgroups: comp.lang.perl Subject: Perl script in Msdos batch file Message-ID: <1740@targon.UUCP> Date: 3 May 91 08:39:38 GMT Organization: Siemens Nixdorf Informationsystems BV.,SWZ, Vianen, the Netherlands. Lines: 36 Now that we have perl also running on msdos, I thought up a way to put perl script inside msdos batch files in the same way we do in sh scripts. What I use is a "header" and a "trailer" to wrap the perl script in: ----Cut Here put in hello.bat ---- @echo = off ; @rem = " MSDOS TO PERL STARTUP LINE perl -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 goto :end " if (0); ##### Perl script ##### print "Hello world\n"; while (<>) { print "input: $_ \n"; } @rem = " MSDOS TO PERL STARTUP LINE :end rem "; ----Cut Here---- My question is, do you see problems with this solution? Has it been done earlier? Can it be done better or more elegant? (this works on msdos 3.3 script must be in your path, not just .) Happy perling, -- The mail| AAA DDDD It's not the kill, but the thrill of the chase. demon...| AA AAvv vvDD DD Ketchup is a vegetable. hits!.@&| AAAAAAAvv vvDD DD {nixbur|nixtor}!adalen.via --more--| AAA AAAvvvDDDDDD Andre van Dalen, uunet!hp4nl!targon!andre