linux perl5.16.3 install / run script error

Posted by grumpy13 on 2014-01-25 17:37

or more to the point, won't run script.
error message;
localhost gary # /home/gary/Perl/printenv.pl run
bash: /home/gary/Perl/printenv.pl: /opt/ActivePerl*/bin/perl^M: bad interpreter: No such file or directory
localhost gary #

i did the; chmod +x /home/gary/Perl/printenv.pl

The shabang line to; /opt/ActivePerl-5.16/bin/perl
(thats where the perl install lives)

tried to run the bash shell over it to see it;
'perl /home/gary/Perl/printenv.pl'

Recoamimdations from google;

So whats up, how do i run perl script in linux - mint - mate

lylcanbys | Tue, 2014-01-28 05:06

Upload your script in Text mode if you use ftp

or

Replace the faulty Windows lineendings ^M with

dos2unix printenv.pl printenv-NEW.pl
or
perl -pi.orig -e 's#\r\n#\n#g' printenv.pl

grahams
ActiveState Staff
Tue, 2014-01-28 09:46

http://docs.activestate.com/activeperl/5.16/install.html#installing%20ac...

Don't unpack the zip file by using the Linux Archive Manager. Use gtar instead as described.

Make sure you have $PATH set correctly after you install.