0

I recently switched from Windows XP to Win7.

Win7 does not pass command line arguments to to the @ARGV array in perl programs. There was no such problem with XP.

Can anyone suggest a fix for this problem?

The did get Win7 to associate the .pl extension with perl.exe

I suspect it has something to do with HKEY_CLASSES_ROOT.pl and HKEY_CLASSES_ROOT\Applications\perl.exe, but I don't know how to set them.

user1067305
  • 3,233
  • 7
  • 24
  • 29
  • 1
    Re "The did get Win7 to associate the .pl extension with perl.exe", yes, but it was done incorrectly. See [the top-rated answer](http://stackoverflow.com/a/7410375/589924) of the linked post. – ikegami Oct 26 '13 at 05:21

2 Answers2

1

Call the script with the perl interpreter included perl blah.pl asdf and not blah.pl asdf as Windows will treat both differently in the newer versions

Check this question for more information and hope it helps as I have not used Windoz in so long.

Community
  • 1
  • 1
MattSizzle
  • 3,145
  • 1
  • 22
  • 42
0

I don't seem to be able to duplicate the problem.

I'm running Active Perl 5.18 on Windows 7, and both command forms give the same output. Can you give an example of input, command, and results?

argv.pl:

foreach (0 .. $#ARGV)
      { print "$_ ", $ARGV[$_], "\n"
        }

.

C:\Perl64\Programs>argv a b c
0 a
1 b
2 c

.

C:\Perl64\Programs>perl argv.pl a b c
0 a
1 b
2 c
Tom Williams
  • 378
  • 1
  • 5