$Your_message=~ s/\n(\n¦\s)?//g; This translates to: "Remove a linebreak followed by: another linebreak, or a whitespace, or nothing" - the "\s" means "whitespace" and the questionmark makes the expressions in parenthesis optional.
Important: The broken pipe "¦" must be replaced by one you enter from your keyboard, or else it will not work. It must be a solid line and not a broken one.
/claus
That sounds like you may have deleted one byte of a 2-byte (Windows) line break.
Maybe try:
s/\r¦\n//gs; # Delete "newlines" and "returns"
or
s/\015¦\012//gs; # Delete CR and LF characters
or
s/[^\S ]//gs; # Delete everything that is whitespace but not a "space"