How do I run a Perl script from Unix command line?

How do I run a Perl script from Unix command line?
Answer
3 Answers
  1. Find the interpreter/executors path. In this case its /usr/bin/perl or /usr/bin/env perl.
  2. Add it to the first line of the file as #!/usr/bin/perl .
  3. Give execute permission to the file chmod +x example.pl.
 

Tìm kiếm

Back
Top