in reply to Remove CR from file on Windows
Unless you use binmode on your input file, CRLF gets converted to LF on read.
Unless you use binmode on your output file, LF gets converted to CRLF on write.
To convert a Windows file to a unix file (on any machine):
binmode($fh_in); binmode($fh_out); while (<$fh_in>) { s/\x0D\x0A/\x0A/g; print $fh_out $_; }
|
|---|