http://qs321.pair.com?node_id=853260


in reply to Re: Unix vs Windows Text File Format
in thread Unix vs Windows Text File Format

You probably meant:

% perl -0015 -pe chomp infile > outfile # or even better % perl -0015 -pe 's{^\cZ$}{}; chomp' infile > outfile # deparse shows that -l0 cannot work % stephan@ape (/c/cygvar/tmp) % % perl -MO=Deparse -l0 -0015 -pe1 BEGIN { $/ = "\r"; $\ = "\000"; } LINE: while (defined($_ = <ARGV>)) { chomp $_; '???'; } continue { print $_; } -e syntax OK # checking % stephan@ape (/c/cygvar/tmp) % % echo abc def | xargs -n1 | perl -lpe '$_.="\cM"' | cat -evnt 1 abc^M$ 2 def^M$ % stephan@ape (/c/cygvar/tmp) % % echo abc def | xargs -n1 | perl -lpe '$_.="\cM"' | perl -0015 -pe ch +omp | cat -evnt 1 abc$ 2 def$
cheers --steph