Reputation: 23275
I have given a perl script file executable permission on a Unix based system, but when I try to execute the file I get a "command not found"
error. I have #!usr/local/bin/perl
at the start of the script file.
Upvotes: 0
Views: 4438
Reputation: 41
replace your first line #!usr/local/bin/perl
with #!usr/bin/perl
(which is called Shebang). Then you can run the file with perl <Path To File>
.
Upvotes: 0
Reputation: 2877
At the top of your script, replace the #!usr/local/bin/perl
with #!/usr/bin/perl
notice the root '/' prior to the usr/
And you can try perl <filename>
keyword to run the file instead of ./<filename>
, using perl keyword should run the script regardless of the shebang line at the top of your script.
Upvotes: 2