Perl Question

Hi everyone

I am not even a novice at Perl scripting .. but had to edit one the other day. The only way I can get it to run is by prefixing 'perl' before running it - ie # perl scriptname

I am running AIX.

Any ideas why i have to do that ?

Thanks!

Perl is a scripting language run by the interpreter program - conveniently called 'perl'. So what you were doing was using your shell to run the perl interpreter and tell it which script to run. Alternatively, you can tell the shell which interpreter to use by putting the interpreter name inside the script. Do this by
having a line similar to

#!/usr/bin/perl

as the first line of your script - replace /usr/bin/perl with the path to your perl interpreter if your system is different.

hope this helps

... and don't forget to chmod the script with executable permission.