One more typo -- you'd type scriptname.pl after you've followed the rest of your instructions. As with any other perl box, you can run scripts one of two ways from the command line:

Placing the files in your $PATH.
If you want to call the file as the name of the file (eg, 'script.pl', then you'll want to use the first two paragraphs -- place the file in your $PATH, make sure it has execute (chmod u+x script.pl), and the proper shebang line... but you call it without calling perl on the command line.
Calling the perl executable with an argument.
This will not search your path, and will only search your local directory (or whatever path you specify. When called this way, you need perl in your path, but not the script. Also, the script doesn't need a shebang line, or be executable.

Update: if you want to make sure perl is in your path, type which perl at the command line. It's installed by default at /usr/bin/perl (but without critical header files that are needed to build new modules, at least in 10.3 server, as I found out today).


In reply to Re^2: Running Perl Scripts on a Mac? by jhourcle
in thread Running Perl Scripts on a Mac? by Spidy

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.