in reply to Problem with ActivePerl 5.6.1 and @ARGV

I think as the OP's have said that its the file association settings. The way you can double check is
perl -e "print qq(@ARGV)" Foo bar baz
Also if you are on win32 then the shebang line is superfluous and IMO confusing.

--- demerphq
my friends call me, usually because I'm late....

Replies are listed 'Best First'.
Re: Re: Problem with ActivePerl 5.6.1 and @ARGV
by mooseboy (Pilgrim) on Dec 13, 2002 at 14:25 UTC

    Thanks to all for the help ... I checked out settings->control panel->folder options->file types and there was clearly some sort of problem. The Perl icon showed a wrong description and the buttons were greyed out, so I created a new one as per the faq link from simonflk. Now, when I do perl -e "print qq(@ARGV)" Foo bar baz I get Foo bar baz, but the original problem remains -- my scripts that use @ARGV are broken, but the ones that don't still work fine. If the problem was just with the file association, then am I right in thinking that *all* my scripts would have been broken, not just the ones using @ARGV? Any further advice much appreciated!

    <Cheers, mooseboy

      If the problem was just with the file association, then am I right in thinking that *all* my scripts would have been broken, not just the ones using @ARGV? Any further advice much appreciated!

      No, only the programs that use @ARGV would suffer. Assuming the problem is that your file association says "when you run script.pl, execute 'perl <scriptname>'". That means that if you type:

      c:\> script.pl foo bar baz
      What gets run is actually
      perl script.pl
      So if a program doesn't use @ARGV, it doesn't care it's being omitted.

      Does that make sense?

      -- Dan

        Does that make sense?

        Yes, thanks for the explanation! Hey, I just noticed today's date ... shoulda stayed at home ;-)

      Please to show us what the file association says for a PL file. Mine shows
      "E:\Perl\bin\perl.exe" "%1" %*
      Also have you rebooted? I know it _shouldnt_ be required. But this is windows after all....

      --- demerphq
      my friends call me, usually because I'm late....

        Monks, enlightenment just dawned -- and what a relief it is with 5 mins to go before the weekend! The file assocation for .pl in fact said:

        "C:\Perl\bin\perl.exe" "%1"

        so I just added the %* at the end as per the suggestions and now all my scripts work fine again! Many thanks to all who took the time to answer; ++votes from me to y'all.

        Cheers, mooseboy