Got something to write about? Check out our Article Builder.

Perl

Moderators: Jonathan
Number of threads: 1187
Number of posts: 3531

This Forum Only
Post New Thread

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!



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 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.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.