I found that all this time I was typing perl filename.pl could have just been typed filename.pl.

Depending upon how your perl was install, you may find that you can just type filename to run your perl scripts.

A way to check this (beyond just trying it), is to run the following command:

c:\test>set pathext PATHEXT=.pl;.COM;.EXE;.BAT;.CMD;;.wlua;.lexe

If .pl appears in the output (not necessarially at the beginning), then you probably can. To further check, try:

c:\test>assoc .pl .pl=Perl

And then:

c:\test>ftype Perl Perl="C:\perl64\bin\perl.exe" "%1" %*

And what all that tells you is that .pl is accepted as the extension for executable files. So, if you type filename, and there is a file called filename.pl in your path, then .pl will be looked up in the associations, (to find "Perl"), and that will be looked up in the ftype database and the command template found there will be used to construct the command that will be executed.

Hence, if I type filename, the command "c:\perl64\bin\perl.exe" "filename.pl" will be executed.

(I never understood why there is a two-stage lookup. There doesn't appear to be any way to have anything other than a one-to-one mapping. But that's how it is.)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

In reply to Re: It's the little things... by BrowserUk
in thread It's the little things... by Lady_Aleena

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.