Excellent answer. I would not have thought of the "
/usr/bin/perl^M", but it makes perfcet sense.
I work in a Windows and Unix environment. One of the most simple yet useful things I've ever found on perlmonks was
a slightly different version for stripping the ^M's. I use it all the time and it's very nice if you have multiple files that need cleanup.
perl -pi.bak -e 's/\cM//g' *.cgi
You don't really need the backup up, but it's nice when you first try it to know that you won't lose your data if it doesn't work.