A similar question is in
ASCII to HTML. To answer your direct question, I would use:
$message =~ tr/\n\r//d;
This deletes any linefeeds or carriage returns. It's much more efficient than the
s/// operator. If you want to format the text for display, you might use
btrott's oneliner:
$message = join "\n<p>\n", grep s/\n/<br>\n/g || 1, split /\n\n/, $message;