in reply to Removing ^M char AKA dos2unix

This does the trick:

perl -e"BEGIN{ binmode STDOUT }" -pe1 file.in > file.out

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^2: Removing ^M char AKA dos2unix
by jdrago999 (Pilgrim) on Feb 27, 2010 at 00:01 UTC

    I like yours better, (and will probably use that from now on) - but this is what I normally do:

    perl -p -i -e 's/\r\n/\n/g' file1 file2 ... filen
      perl -MExtUtils::Command -e dos2unix file1 file2 dir1
      Or better still, install dos2unix utility