Click to See Complete Forum and Search --> : What does this mean?


Bill who?
06-14-2001, 02:20 PM
I am in the process of learning perl. My first program was simply:

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

I saved the file as hello then performed:

chmod +x hello

I type in hello at the command prompt and get an error. I looked into the directory that stores hello and it shows up like this:

hello*

The "hello" is green and the asterick is gray. What does this mean?

P.S. I can run the program by typing:

perl hello :confused:

YaRness
06-14-2001, 02:30 PM
try "./hello" and see what it says.

and if yer gonna say you got an error, it helps those who want to help you if you say what the error was.

kmj
06-14-2001, 03:08 PM
the green and the * mean that it's an executable file.

like YaR said, if you want more help on the error, you'll have to be more specific.

EyesWideOpen
06-14-2001, 03:17 PM
Originally posted by Bill who?:
My first program was simply:

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

Just so you know, there's no need for the parenthesis (sp?) in the print statement. i.e., print "Hello, World!\n"; is all you need.

klamath
06-14-2001, 04:01 PM
And you should probably be using 'use warnings' and 'use strict' (for this, it's obviously overkill but it's good to get used to beneficial habits).

TheLinuxDuck
06-14-2001, 07:44 PM
Don't forget -w (in the shebang line, as <STRONG>#!/usr/bin/perl -w</STRONG>). That, along with <STRONG>use strict;</STRONG> will help you out with perl code.