What kind of file is it, actually? Smells like a csv file with multiline fields, in which those lines are separated by ^M. In any case, that smells like an XY problem.
There's no such thing as a DOS line feed - a line feed is "\n" or ASCII 10. Carriage return is "\r" or ^M or ASCII 13. DOS line endings are "\r\n" (or CRLF). Establish what is your line ending proper (possibly "\r\n"), read the lines setting $/ to that line ending (see perlvar), then convert any (multiple) "\r" occurrences as per the specs of the task (which are those?). A few sample lines would be helpful for further advice.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Perl Regex to Fix line feed issue
by shmem
in thread Perl Regex to Fix line feed issue
by mmittiga17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |