in reply to Execute a Perl code without ".pl" extension
1) You include the shebang #!/usr/bin/perl -w at the top of your script
Update:As Moriarty points out below, your shebang should point to your perl binary, which may be /usr/bin/perl, or may be /usr/local/bin/perl, or may be somewhere else, but can be found with the command which perl
2) Rename your script from myperlcode.pl to myperlcode
3) Change permissions on your script like: chmod +x myperlcode
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Execute a Perl code without ".pl" extension
by Moriarty (Abbot) on Mar 10, 2006 at 01:45 UTC | |
by moklevat (Priest) on Mar 10, 2006 at 02:03 UTC | |
by Moriarty (Abbot) on Mar 10, 2006 at 02:53 UTC | |
by thor (Priest) on Mar 10, 2006 at 04:25 UTC |