# We don't want to put text right up against itself so # replace with a space rather than nothing. /s treats it # all as a single line - very important. $message =~ s/\r\n|\n|\r/ /gs;