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


in reply to Converting carriage returns to HTML breaks

You can also cheat:

use CGI; my $html_break = CGI->br; $message =~ s/\Q\r\n\E/$html_break/g;

Not sure if that does what you want, but it's worth a shot.

~Thomas~