in reply to Removing Carriage returns from text files

You should get what you want by using binmode to create the file:
use strict; open OUTFILE, ">binfile"; binmode OUTFILE; print OUTFILE "1\n2\n3\n4\n"; close OUTFILE;
This creates a file which at the dos prompt shows as having a size of 8 bytes. Hope this helps!

Update: So if you start with an existing file, try the following:

use strict; open OUTFILE, ">binfile"; binmode OUTFILE; open INFILE, "<CrLf"; my @lines = <INFILE>; close INFILE; chomp @lines; foreach (@lines) { print OUTFILE $_,"\n"; } close OUTFILE;
Or read/chomp/print line by line.

"Make everything as simple as possible, but not simpler." -- Albert Einstein