I ran your exact script and got the right result.
>ARGVtest.pl
$VAR1 = [];
-1
I think your system's handling of .pl files is broken.
- First, get the file type from the default key of HKEY_CLASSES_ROOT\.pl. For me, it's "Perl".
- Then, set the default key of HKEY_CLASSES_ROOT\Perl\shell\Open\command to "c:\perl\bin\perl.exe" "%1" %* (where "Perl" is the file type from the first step).
As a .reg:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.pl]
@="Perl"
[HKEY_CLASSES_ROOT\Perl]
@="Perl File"
[HKEY_CLASSES_ROOT\Perl\shell]
[HKEY_CLASSES_ROOT\Perl\shell\Open]
[HKEY_CLASSES_ROOT\Perl\shell\Open\command]
@="\"c:\\perl\\bin\\perl.exe\" \"%1\" %*"