stuart arnold a écrit :
Ok, I saw various responses, and, if what you want is a "batch" file to invoke PERL
Read his question again, he want it the other way around : from .bat to .pl
, you cannot do it as ".bat", rather, a very old trick is to make the fike a ".cmd" and have it assoc'd as a .bat file. (or closely there of). From a script that someone VERY generously gave me back 15 yrs ago(and I still use) is this: 1) you make it LOOK like a BAT file 2) invoke PERL. Ok, what this does is tell the BAT file that: @rem = ' Lets the script(BAT) act as a DOS script. The other '@' are escaping things, Then it invokes your PERL script (whatever.cmd) When PERL invokes this EXACT script, it thinks '@rem' and other stuff are vars and exits. It then proceedes to execute! To run this example, just save it (eg thingy.cmd) and type "thingy" (since .cmd is part of the invocation) Seriously cool trick (from some JEDI-PERL dude(wich I new who it was) in a galaxy near you!)
cut ! This trick is strange : there are easier ways to do that, and you CAN use .bat . To see how it is done just use the perl2bat script (in ActivePerl distribution) on one of yours script, you can do it by hand quite easily when you know the trick. It use the -x switch that make perl discard any line before a line that start with #! and contain "perl" (a shebang). -- Jedaï _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
