Perl

Moderators: Jonathan
Number of threads: 1209
Number of posts: 3566

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Running Simple Perl Script Posted by LearningPerl46 on 20 Nov 2009 at 8:41 AM

Hi all,
I am a rookie to the Perl World. I am running sun OS 5.8, and I (created) or vi a file named helloworld.pl under my home folder and gave it proper permission with the command chmod a+rx helloworld.pl:

-rwxr-xr-x 1 docalvi wanops 38 Nov 20 07:00 helloworld.pl

/opt1/home/docalvi

and in the file, i inserted the following text:


#!/usr/bin/perlprint "Hello World!n";

and I saved it as helloworld.pl

when I tried to execute the file ./helloworld.pl

I get the following error message:

./helloworld.pl: No such file or directory

What have I done wrong? Can someone answer the question? Thx much!



Report
Re: Running Simple Perl Script Posted by csnmoss on 28 Nov 2009 at 10:43 PM
change
#!/usr/bin/perlprint "Hello World!n";

to

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

then run it as follows

./helloworld.pl

or try running it as follows

perl ./helloworld.pl

Report
Re: Running Simple Perl Script Posted by LearningPerl46 on 29 Nov 2009 at 11:47 AM
thank you very much. That works great!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.