Once you have perl set up on Windows, there are a few tricks you can use to make it easier to execute them. Normally, on unix & windows, you can execute a perl script like this:

perl myscript.pl

On Unix, if you don't want to type the "perl" part anymore, you just add a "shebang" line like "#!/usr/bin/perl" to the top of your file, mark the file as executable (chmod u+x myscript.pl) and then you can execute it like this:

myscript.pl

But this won't work on NT. Here's how to accomplish something similar:

ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*

Now you can execute your scripts without first typing "perl" just like on unix.

You can also one step further. There is a system environment variable called "PATHEXT". Go get to it, right-click on "My Computer", select "properties", then click "Advanced", then "Environment Variables" (Might be different for NT). Find the "PATHEXT" variable under the system section, and add ".PL" to it. Now, no matter where you are on your system, if your script is in the path, you can call it like this:

myscript

So now even though its called "myscript.pl" it works just like a ".exe" or ".com" file - you don't need to specify the extension, and you can call any perl script in your path from anywhere on the system.


In reply to Re: A Perl Environment by meetraz
in thread A Perl Environment 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.