Perl Print MacOSX

umassrebel

Registered
I just bought a MacBook Pro and as I was told, Perl is already installed. However, when I try and run my perl script helloworld.pl, nothing appears. I type "perl helloworld.pl" and nothing shows up in the terminal. The helloworld.pl contains the following segments of code:

#!/usr/bin/perl
print "Hello World \n";

I am running Mac OS X 10.6.4

Can someone tell me what I am doing wrong? I've tried setting the permission to helloworld.pl to executable by typing in "chmod -x hellloworld.pl" in the terminal so when i type "./helloworld.pl" it will executes. Yet, I get the same result as when I typed "perl helloworld.pl".
 
I tried your script (on 10.6.4 also) and it work, i.e.

perl helloworld.pl

printed Hello World.

However, instead of chmod -x, use chmod +x. -x removes the execution permission.
 
Back
Top