in reply to Reaped: Perl RegEx

In the upcoming 5.14, you can do
$var = ($var =~ s/\n//gr) =~ s/\s+//gr;
Note that for your particular case,
$var =~ s/\s+//g;
will do, as newlines are whitespace.