Use
$text =~ s/\n/<br>/;
instead of
$text =~ s/\\r\\n/<br>/;
Good luck!
In reply to Re: Replacing line returns with br by Anonymous Monk in thread Replacing line returns with br by dpatrick