There is a similar question about Windows, but it won’t work for Unix based computers (OS X specifically).
I want to type the name of a file, say example.pl or example.pl parametertext.txt, and have it know to execute perl.
I specified #!/usr/bin/perl in the file so it can find the executable. Instead, I get the message:
bash: example.pl: command not found
You can do it this way,
/usr/bin/perlor/usr/bin/env perl#!/usr/bin/perl.chmod +x example.plNow it will run