Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

If your a perl programmer on Windows and find yourself running perl programs from the CLI (Command Line Interface) and get annoyed by having to run perl foo.pl all the time, then this is for you.

You don't have to do this if your running Windows NT 4/5 (2000) because theres a way round it. There are two little programs called assoc and ftype. These programs allow tou to associate the .pl extension or any other extension you use with the perl interpretor. so when you want to run a program called foo.pl you can just type foo at the CLI, as long as its in your CWD (Current Working Directory) or your PATH.

All you will need to do is follow these steps.

1) Open up a CLI. and enter these commands:
C:\> assoc .pl=PerlScript
C:\> ftype PerlScript=C:\Path\To\Perl\bin\perl.exe %1 %*

2) While still in the CLI type this:
C:\> set PATHEXT=.pl;%PATHEXT%

The PATHEXT environment variable contains the extension(s) to executables. So by adding .pl to this anything (files) found with the .pl extension will be treated as executable. This will only last for your CLI session, so if you want to make this a permanent thing do the following:

1) Right click on 'My Computer' and select properties. 2) Move along to the Advanced tab. 3) Click on Environment Variables. 4) In the System Variables double click on PATHEXT. 5) Append a ';.pl' to the end or a '.pl;' to the beggining of the Vari +able value box. 6) Click on all of the OK's and Apply's, restart your CLI and try it o +ut.

Edit kudra, 2002-02-26 Added 'NT' to title per ntc request

Edit by tye to change PRE to CODE when around long lines.


In reply to Win32 Execution: UNiX Style (NT) by emcb

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (11)
    As of 2014-07-29 20:54 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (228 votes), past polls