- or download this
Unix: octal \012 hex 0xA dec 10 LF may be \n
Dos: octal \015\012 hex 0xD0xA dec 13 10 CRLF may be \r\n
Max: octal \015 hex 0xD dec 13 CR may be \r
- or download this
$textfield =~ s/\015\012|\015|\012//g;
If you prefer hex to octal :-)
$textfield =~ s/\xD\xA|\xD|\xA//g;
- or download this
In expanded commented /x form:
...
/ # with literal ''
/xg; # /x allow comments, /g do globally