argstest.pl Hello ... New build is 64-bit Perl28 from ActiveState.

Check your file association for perl*. My guess is it's just running c:\path\to\perl.exe "%1". If that's the case, then none of your other command-line arguments are being passed to argtest.pl, hence the ARGV is undefined. You want the association to be something like c:\path\to\perl.exe "%1" %*, where the %* passes the remaining command-line arguments to the script.

FOOTNOTE *: sometimes assoc .pl then ftype perl_auto (replace perl_auto with the results of the assoc). If not there, run regedit, then search either HKEY_CLASSES_ROOT\.pl or HKEY_CURRENT_USER\Software\Classes\.pl, look in the "(Default)" item, which will tell the name of the class (might be perl_auto; on my system, since i manually associated, it's called PerlScript); then at the same level as .pl, search for a key (folder) with that name, then dig into the ...\shell\xxx\command\(DEFAULT), where xxx will be "run" or "open" or some such.

update: haukex's suggestion of "Have you tried running perl argtest.pl Hello" would lend further strength: if that command works, but the auto-associated run does not, it's almost certainly the file association.


In reply to Re: command line args by pryrt
in thread command line args by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.