join "\n\n", map { s/\s+/ /; $_ } split(/\n{2}/, $_, -1);