At 3:53 pm -0500 22/12/04, Isaac Sherman wrote:
Then, when, in the terminal, I typed: hw.pl while in the same directory, I got the following message.
tcsh: hw.pl: Command not found.
As others have said, you can run junk.pl using the command
perl junk.pl
and this will work even if a) the file is not executable and b) there is no shebang.
You can also execute the script using
./junk.pl
but in this case a) the permissions must be modified to make it executable and b) you must use the shebang (eg #!/usr/bin/perl). The sequence below illustrates the procedure.
JD
bash-2.05a$ cd bash-2.05a$ echo '#!/usr/bin/perl print qq~Hello\n~' > junk.pl bash-2.05a$ junk.pl bash: junk.pl: command not found bash-2.05a$ perl junk.pl Hello bash-2.05a$ ./junk.pl bash: ./junk.pl: /usr/bin/perl: bad interpreter: Permission denied bash-2.05a$ chmod 755 junk.pl bash-2.05a$ ./junk.pl Hello bash-2.05a$