I don't know about NT5, but in NT4 associating .pl files to perl does not get the arg list passed to perl. I think there is some syntax you can use when you set up the association.
In DOS, IIRC, the numbered variables $1 $2 and so on are the command line args. Note that $0 is the name of the command.
The batch wrappers use this to work. They generally call perl and have it read in and execute $0 with $1 etc as args. Look inside them for help, there may be a general arg list DOS variable, but I don't know what it is..
You may just want to buy/get a unix shell for windows. I use MKS toolkit at work. The main thing I like about it (I almost never use its shell) is that I get many of the unix command I know and love while I am in dos-hell. Just the addition of a decent more is a wonderful thing...
UPDATE: PiEquals3 is quite right about the variables. Use %1, etc. for batch files. I just discovered that %* is all the args. Which language am I using?
REM foo.bat
echo %*
REM End of foo.bat
c:\foo bar baz
bar baz
So, I just tried switching my .pl association to 'c:\perl\bin\perl.exe %0 %*'. It seems fine so far.
TGI says moo
|