in reply to Turning *off* warnings causes the script to fail :(

Your shell was trying to run an interpreter called "perl\r". If you want a quickie demo, create a symlink in the directory where the script resides with the following command:

ln -s `which perl` `echo -ne "perl\r"`

Now change the shebang line to invoke perl via the symlink in the current directory, being careful not to remove the carriage return:

#!./perl

Invoke your script and the shell will exec perl via the "perl\r" symlink without complaint.

Update: I should add the magic incantation to remove the nasty symlink:

rm `echo -ne "perl\r"`