On the command line (cmd.exe) check:

>assoc .pl .pl=Perl >ftype Perl Perl="E:\Perl\bin\perl.exe" "%1" %*

This (path to perl.exe according to your machine) would assure you, that your Perl is properly installed.

You should be able to call perl scripts just by name.

You can can even go further and:

>set pathext PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH >set PATHEXT=%PATHEXT%;.PL

With that you are able to call you perl script just by name, even without the .pl extension (provided no other file with same basename and other executable extension is found before your script is concidered).

You can make the environment change permanent by editing PATHEXT in start>settings>system>advanced>environment

Under these circumstances

>echo print "@ARGV" >targ.pl >targ 1 2 3 1 2 3 >perl -e "system 'targ', 1, 2" 1 2

But, I've seen that misbehaviour (script name triggers execution, but @ARGV is not available) reported a few times in the past (for W2K and XP). Heck, I even had once such a machine (NT4) years ago at work, but did not know enough then about perl and Windows command execution to solve the mystery.

In all these cases a call of perl with the script (and its parameters) as argument was processed correctly.

I will sleep better, once someone is able to explain what causes this (and I can read it somewhere posted) ;-)


And Celada++ for the post right on spot wrt Shebang parsing.


In reply to Re: ARGV Problem by pKai
in thread ARGV Problem by tjdmlhw

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.