binmode($fh_in); binmode($fh_out); while (<$fh_in>) { s/\x0D\x0A/\x0A/g; print $fh_out $_; }