newbie question

J

John Bokma

usr said:
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 :-D.

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.
 
A

Arndt Jonasson

Tad McClellan said:
#!/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.
 
U

usr

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Newbie Question 9
Perl Newbie 2
Tasks 1
CSV confusion newbie question 1
Learning Object Oriented Programming (newbie) 23
Newbie Hash question. 13
Newbie... 2
Newbie question !! 3

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top