Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > newbie question

Reply
Thread Tools

newbie question

 
 
John Bokma
Guest
Posts: n/a
 
      03-23-2005
usr wrote:

> hi
> I feel embarrassed to ask this question


Reduce this feeling by reading:
<http://www.catb.org/~esr/faqs/smart-questions.html>

Quite some questions here are newbie questions, no need to state this
(it's often clear from the rest of the message).

> I'm using linux and this is my code
> /usr/bin/perl
> print "Hello, World!\n";
> I then
> chmod a+x program_name
> then
> ./program_name
> then the terminal screen just sits until I stop it.


Change the first line to:

#!/usr/bin/perl

> Thanks,
> please enter giggles and restraind laughter were you see fit.


No giggles, but a sound advice: read a good book on Perl (Learning
Perl), read it front to back, and then start at the beginning again. The
first time: *don't* sit behind a computer. The second time, yes. And
make sure you make notes the second time you read it .

A little extra: make sure you put the following two lines under the
first line:

use strict;
use warnings;

The latter "replaces" the -w one can see now and then after the /perl in
the first line.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      03-23-2005
usr <(E-Mail Removed)> wrote:

> I'm using linux and this is my code
> /usr/bin/perl
> print "Hello, World!\n";



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


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Arndt Jonasson
Guest
Posts: n/a
 
      03-23-2005

Tad McClellan <(E-Mail Removed)> writes:
> usr <(E-Mail Removed)> wrote:
>
> > I'm using linux and this is my code
> > /usr/bin/perl
> > print "Hello, World!\n";

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


Just adding some information: what happened when the #! sequence
wasn't present was that the program /usr/bin/perl was called in the
ordinary way from the script. And when called without any arguments,
it just sits and waits for input (on standard input, not from the
script being executed) to treat as Perl code and execute.
 
Reply With Quote
 
usr
Guest
Posts: n/a
 
      03-24-2005
hi
I feel embarrassed to ask this question but I'm pretty new to this and
can't seem to get it.
Right here it is, How do I get the program 'Hello, World!' to run.
I'm using linux and this is my code
/usr/bin/perl
print "Hello, World!\n";
I then
chmod a+x program_name
then
../program_name
then the terminal screen just sits until I stop it.
Thanks,
please enter giggles and restraind laughter were you see fit.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Newbie! I'm a newbie! What's wrong with this program? Id0x Python 4 07-20-2003 11:40 PM



Advertisments