I am a new Ubuntu user, trying to run scripts developed on Straberry Perl on Windows 7. My Ubuntu environment is Ubuntu 14.04 LTS and Perl 5.18.2.
The first line of my scripts is #!/usr/bin/perl
, which should invoke the perl interpreter in /usr/bin, and indeed, there is a 10.2 Kb object living there. However, my scripts won't run unless 'perl' is the first command line argument on Terminal, as in perl myscript.pl
.
Is there a way to have perl automatically running .pl scripts without invoking it explicitly?
./myscript.pl
which perl
?ls -l myscript.pl
? In particular, what are the permissions — is there anx
in the list (something likerwxr-x-rx
)? You may need to enable the executable bit:chmod u+x myscript.pl
will make it executable for the owner (i.e., you, presumably).