[Chicago-talk] Newbie problem: Cannot get Hello World to run!
Sachin Karol
skarol1 at uic.edu
Sun Jan 18 21:54:58 CST 2004
Hello,
Hope the Perl gurus can help me with a typical newbie
(I think!!) problem.
After many hassles, I managed to load Suse 9 on my laptop.
I am now trying to learn Perl and am using the famed " Learning
Perl" from OReilly.
This is what my problem is:
I am trying to run the basic Hello World problem :-
#!/usr/bin/perl -w
print ("Hello, world!\n");
I tried to save this into a file named Hello, ran chmod +x on
it and then typed Hello at the prompt. This is my output :-
bash: Hello: command not found
Then I tried using the following command :-
perl Hello
This is the output :-
print (...) interpreted as function at Hello line 2.
Hello, world!
and if I remove the first line and then run 'perl Hello', I am able
to run the program properly.
What am I doing wrong? I thought that by including the path with
the '#!' as the first line of the program would not require me to
write perl at the command line. Is there something I am missing?
Running 'whereis perl' gives me:-
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
Please advice
Thanks
Sachin Karol
More information about the Chicago-talk
mailing list