in reply to can't see ^M to process.
^M is vi's representation of carriage returns. When you prit them in Perl, it causes the cursor to move to the beginning of the line. For example, try
# \015 is carriage return. print("Hello\015you\n");
You should see "youlo" on the screen. If you redirect the above to a file and open it in vi, you will see "Hello^Myou".
The following Perl code will remove CRs:
while (<>) { s/\015//g; print $_; }
|
|---|