You didn't say, but I will assume that you are on Windows and that you did the default Active State Perl installation. This should have put Perl into your path. You can verify this by typing "perl -V" at the command line - you should see a bunch of configuration stuff.

To run your myProgram.pl, type>perl myProgram.pl

If you want to run a program by just typing the name (myProgram.pl) instead of having to type perl first, there are 2 more installation steps that you need to do.

1. You need to associate .pl with the perl interpreter. This is how: Associating .pl as an exectutable. This enables you to click on a perl program icon and have it run.

2. To make the command line "happy", You need to tell the shell that .pl is an executable. You do this by setting an environment variable. see managing environment variables for how to use the GUI to do this. The PATHEXT environment variable is what controls this and needs to have .pl in it.

Probably easiest is to reboot your machine after you've done (1) and (2).

To view your environment, type "env" or "set" at the command prompt.
If you did (2) right, you will see something like this:
PATHEXT=.COM;.EXE;.BAT;.CMD;.pl
Of course there is going to be a bunch of other lines!

So (2) tells the command line that .pl is an executable file and step(1) tells the system what program to run (e.g. perl). However, typing "perl yourProgram.pl" should always work and should "work out of the box" with the standard installation.


In reply to Re: Active Perl by Marshall
in thread Active Perl by sudlo

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.