http://www.perlmonks.org?node_id=504690


in reply to Re: How to remove a carriage return (\r\n)
in thread How to remove a carriage return (\r\n)

But what happens when $str = "ab\ncd\r\n"? Or can we assume there are no line breaks except at the end of lines?

Replies are listed 'Best First'.
Re^3: How to remove a carriage return (\r\n)
by 3dbc (Monk) on Nov 13, 2012 at 16:13 UTC
    $line =~ s/\R//g;