Running Perl programs

Running Perl programs

To run a Perl program from the Unix command line:

perl progname.pl

Alternatively, put this as the first line of your script:

#!/usr/bin/env perl

... and run the script as /path/to/script.pl. Of course, it'll need to be executable first, so chmod 755 script.pl (under Unix).

(This start line assumes you have the env program. You can also put directly the path to your perl executable, like in #!/usr/bin/perl ).