CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:


New User

Apr 2, 2013, 5:39 PM

Post #1 of 7 (660 views)
Path Can't Post

I am totally new, I did some checking and found that on a Mac running 10.8.3 has Perl installed, I did a perl -v from the terminal window and it shows (v5.12.4), but when I try to execute any command at all I get a error message saying,
-bash: print: command not found, I believe it does not know where to find the proper directory, do I need to set a path statement, and if so, how do I do it? Any help is appreciated.

Please remember, I as new as new can be!Unsure

Veteran / Moderator

Apr 2, 2013, 5:51 PM

Post #2 of 7 (659 views)
Re: [N2netr] Path [In reply to] Can't Post

Do you have a shebang line in your script and does it have the correct path to perl?

New User

Apr 2, 2013, 5:58 PM

Post #3 of 7 (657 views)
Re: [FishMonger] Path [In reply to] Can't Post

Not even close to writing a script, just doing this,

daniel-wilkinsons-imac-6:~ Danny$ print "Hello World/n";
-bash: print: command not found

daniel-wilkinsons-imac-6:~ Danny$ perl -v

This is perl 5, version 12, subversion 4 (v5.12.4) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at, the Perl Home Page.

daniel-wilkinsons-imac-6:~ Danny$ echo $PATH

daniel-wilkinsons-imac-6:~ Danny$

It does not appear to know where the cmd "print" is located.

New User

Apr 2, 2013, 6:07 PM

Post #4 of 7 (656 views)
Re: [FishMonger] Path [In reply to] Can't Post

I guess you can say I know I have Perl installed, but I do not know where it is, and do I have to set it up in a Path statement to find the commands that I am typing from the terminal window, like I said, I am as new as new can be.


Apr 2, 2013, 6:26 PM

Post #5 of 7 (651 views)
Re: [N2netr] Path [In reply to] Can't Post

Create a file called In that file, enter the following script:

#!/usr/bin/env perl 
use strict;
use warnings;

print "Hello, world!\n";

Open a terminal in the directory (or cd to that directory), and then enter the following at the command line:


You should then see:

Hello, world!

New User

Apr 2, 2013, 7:11 PM

Post #6 of 7 (647 views)
Re: [Kenosis] Path [In reply to] Can't Post

Thank you, at least now I can run the examples in the book I bought, it is Elements of Programming with Perl, I am told it is a great book for beginners, I appreciate your patience and thank you for your assistance.


Apr 2, 2013, 7:28 PM

Post #7 of 7 (644 views)
Re: [N2netr] Path [In reply to] Can't Post

You're most welcome, N2netr!


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives