in reply to Removing Carriage returns from text files

What's wrong with just:
open( FILE, "$file" ) || die "Unable to open $file: $!\n"; undef( $/ ); $contents = <FILE>; close( FILE ); $contents =~ s/\cM//gis; open( FILE, ">$file" ) || die "Unable to write to $file: $!\n"; print FILE $contents; close( FILE );
Note: This is untested! :)