How do I run a Perl file in Unix?

How do I run a Perl file in Unix?
Answer
You can do it this way,
  • Find the interpreter/executors path. In this case its /usr/bin/perl or /usr/bin/env perl.
  • Add it to the first line of the file as #!/usr/bin/perl .
  • Give execute permission to the file chmod +x example.pl.
 

Tìm kiếm

Back
Top