Linux won't recognize shebang line
I was hoping someone could help me with a strange situation:
I have a Red Hat Linux 8 installation, all the standard stuff, including perl and am using the bash shell.
I wrote the standard "Hello World" Perl program and attempted to execute it with the command:
The shell replies:
-bash: hello.pl: command not found
The shebang line at the top of the program says:
And the command: which perl tells me:
The file permissions are: -rwxrwxr-x
The programs does run correctly with the command:
> perl hello.pl
I have also used hexdump to look at hello.pl and ensure that it has only newlines (\n) at the end of the lines and not any extraneous carriage returns (\r).
I hope that is enough info to show that I have investigated all the ordinary things that go wrong, but I am still stumped.
BTW: I have also tried running this under bash2, csh and sh ... with the same results. This happens with any .pl or .cgi programs I try to run. All the programs I have also tested on other Unix systems and they run fine.
Please help if you can. Thanks.