[CentOS] Perl CGI scripts - stripping out unwanted carriage returns etc

Mon Oct 13 16:00:34 UTC 2008
Andrew Allen <andy.allen at virgin.net>

I have a number of perl CGI scripts which I wrote some time ago (and
which are working successfully on my website). I've set up a local
server on which to do some development work on the scripts but I can't
get them to work - the error log says:
No such file or directory: exec of '/var/www/cgi-bin/script.cgi' failed
Premature end of script headers: script.cgi     etc

By comparing two identical very simple cgi scripts (one works, the other
doesn't), I've traced the problem to, apparently, unwanted carriage
returns which have somehow got into the perl text files. Is there a
quick and easy way (ie piece of software) to strip out these things, or
do I have to do it manually?
Thanks for any help,
Andy