chmod +x cpg4.pl
| [reply] [d/l] |
| [reply] |
Just to amplify on Monk::Thomas's reply, the reason you need to put a ./ in front of commands run in the current directory, is to prevent the system from searching your system PATH first. What if the file name was identical to something else in your PATH? It gets confusing and is a security hazard, so the rule is put ./ in front of any command run from the current working directory. I hope it helps you remember it, it becomes second nature after awhile. :-)
| [reply] |
Easiest way is typing perl cpg4.pl at the bash prompt, This runs the perl interpreter on your program.
Another way is add a "shebang" (#!/usr/bin/perl) line at the beginning of your script and mark the script as executable with the "chmod" command, and then run it like any other executable script.
| [reply] |
| [reply] [d/l] |
CountZero brings up a good point. This issue is why I like to use
#!/usr/bin/env perl
as the shebang, when I am on a linux or Mac OS X system. This way, it will run the script using the first perl found in your path. This node contains some more discussion on the topic: /usr/bin/env perl - query
| [reply] [d/l] |