in reply to Re^2: Why doesn't @ARGV work?
in thread Why doesn't @ARGV work?

Now, I'm really confused !!!

I just set up another new Gateway, identical to the Win8 system I was using yesterday and installed Perl as before. I get the same result as yesterday:

numargs = 0

Obviously, the correct little Perl script is running. At the moment, I just shut that machine off, and I will try the suggestion of using $#ARGV-1 instead of @ARGV. But I would not expect that to make any difference.

This result seems to rule out any issues with the op sys on the other machine. I opened a standard CMD window, typed the program using Notepad, and ran it. So there was nothing else installed, otherwise a virgin machine.

Has anybody else has any issues with Win8?

Replies are listed 'Best First'.
Re^4: Why doesn't @ARGV work?
by LloydRice (Beadle) on Jul 17, 2014 at 16:12 UTC

    There was one reply yesterday about possible issues with batch or pl2bat. This is using neither of those. I am familiar with the %* argument in batch files and I did once look at pl2bat. But now, I am running the Perl script via the Perl system directly from the CMD command line.

      It has been a while since I used windows last. But can you try using Strawberry Perl on Win 8? Instead of ActiveState Perl. I had some issues using ActiveState Perl when I was using windows, but with Strawberry I was very much ok. That was on Win7

      If you tell me, I'll forget.
      If you show me, I'll remember.
      if you involve me, I'll understand.
      --- Author unknown to me

        My apologies to Anonymous Monk. I did know that these were OK. However, I did not respond to your question as I should have.

        I knew that the assoc assignment was OK because the script did run, as evidenced by the erroneous output. I avoided the ftype question by specifically including the .pl extension in my test. And, in answer to your question, the value of assoc .pl was assigned as "Perl". ftype Perl was (at that time) not assigned a value.

        But here is a related question. Does the symbol used in the assoc/ftype values appear anywhere else than these two commands? Specifically, does it matter whether the symbol used is "Perl" or "PerlScript" (or, for that matter, in lc or with caps)?

        And finally, I should add that I have since installed Strawberry Perl on the newer of the two Win8 machines and all is well there. I have now done a full "recovery" on the older machine and have not yet reinstalled Perl there.