in reply to executing perl script

Have you tried
perl -i -pe 'y/\r//d' script.pl
?