in reply to Unix vs Windows Text File Format

in the shell run
perl -pi '.bak' -e 's/^M//' <FILE_NAME>

Note: ^M above is actually a literal [CTRL]-M, this can be entered in the shell as [CTRL]-V [CTRL]-M
([CTRL]-V - "take the next character as a literal")

Edited as dave_the_m pointed out, I had the run options in the wrong order, I can only put this down to a lack of caffeine

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: Unix vs Windows Text File Format
by dave_the_m (Monsignor) on Aug 05, 2010 at 10:09 UTC
    perl -epi ...
    Er, no. That executes the code 'pi' with the rest of the line as @ARGV, which is effectively a noop. Also there mustn't be a space between -i and its arg. Lastly, using \r is to be much preferred than a literal carriage-return control character. You want this instead:
    perl -pi'.bak' -e 's/\r//' <FILE_NAME>

    Dave.