in reply to Removing Carriage returns from text files
Since you are on Windows you will need to binmode() your output handle. If you don't it will automaticly add the CR to your LF every time you output a LF.
This code will remove the \r at the end of the line only. If you want to strip all \r's you will need to do s/\r//; imediatly prior to the print statment.open(INFILE, "< input.txt") or die "Failed to open input: $!\n"; open(OUTFILE, "> output.txt") or die "Failed to open output: $!\n"; binmode(OUTFILE); while (<INFILE>) { print OUTFILE }
In Section
Seekers of Perl Wisdom