When you say "I get nothing", I think you really meant to say that you get an error message and to actually tell us exactly what that error message was (cut'n'paste it).
I'd guess that your PATH got updated but you were trying to run the Perl script in a command window that didn't have the up-to-date PATH. See CleanPath for once way to make dealing with this a bit easier.
The trailing \ that you noticed wouldn't have been a problem (as you verified). You most likely used the GUI to change the environment settings and this notifies your desktop 'shell' (explorer.exe, not the command 'shell' that Unix users are used to thinking of when they hear 'shell') to fetch the latest environment settings. If you then open a new command prompt, it will have the updated PATH (so that perl.exe can be found).
And, of course, the claims in this thread that you can't pass arguments via file associations in Windows are wrong (as you verified).
See what you get when you run these commands:
C:\>assoc .pl
.pl=Perl
C:\>ftype Perl
Perl=perl -Mouse "%1" %*
C:\>
My output shows that I've set my associations to use my -Mouse module so that double-clicking a *.pl file (or drag'n'dropping to a *.pl file or downloading a *.pl file from a trusted web site [risky!]) will not create a command window that just disappears when the script finishes or fails.
The %* is what causes the arguments to get passed along. The "%1" is the name of the script and the quotes are what allow it to work on paths/files that contain spaces.
You might also like to try pl2bat. Although the bug of "script.pl >output.txt" and "script.pl | more" not working with file associations has been fixed in modern versions of Windows, I still use pl2bat for all of my Perl scripts (in part so that my -Mouse trick doesn't affect scripts meant to be run from the command line).
|