A script stopped working when I moved it from Win 2003 server to Win 2008. After some troubleshooting it seems that it was not grabbing the command line parameters.
So I did a print $ARGV and exit at the beginning of the file and I get this:
Expand|Select|Wrap|Line Numbers
Use of uninitialized value $ARGV at .... line X
I'm using perl from a folder, not installed or in window's path.
It's been my experience that this is a common problem when the OP has never installed perl and is using a port which makes you set these types of settings without a supplying any defaults.
The action attribute of the open setting within the file type association should be set to something like this:
"C:\Perl64\bin\perl.exe" "%1" %*
The key part being:
"%1" %*
which sets/allows for the acceptance of the script arguments aka @ARGV. Calling the perl interpreter directly and passing it the script and args will "get around" the problem, but is not the best/proper solution.
This is most puzzling because I have worked on both windows platforms you mentioned, doing Perl development of course, and never experienced this issue. I am anxious to see what happens with Ron's last suggestion.
It's been my experience that this is a common problem when the OP has never installed perl and is using a port which makes you set these types of settings without a supplying any defaults.
The action attribute of the open setting within the file type association should be set to something like this:
"C:\Perl64\bin\perl.exe" "%1" %*
The key part being:
"%1" %*
which sets/allows for the acceptance of the script arguments aka @ARGV. Calling the perl interpreter directly and passing it the script and args will "get around" the problem, but is not the best/proper solution.
I half-heatedly explained that perl is not installed, but since it "worked" I didn't have any technical reasons why ARGV wouldn't work.
It does have to do with file association, because like he said when I gave my file to perl.exe it worked!
Expand|Select|Wrap|Line Numbers
C:\temp\Perl64\bin>perl.exe C:\test.pl test test test
$VAR1 = [
'test',
'test',
'test'
];
Awesome! Thank you.
Why not installed? This is a loaned/borrowed server and want to return it in the same exact shape I got it. (Running everything from inside a folder makes for easy cleanup later)
I am certainly glad that Ron's suggestion was the issue. On another note, specifically the issue of returning the server in the condition you found it, portable apps are your friend. In fact, Strawberry Perl has a portable version that you can put on a stick. Enjoy!