$text = do { local $/; <>}; $text =~ s/\n//g; # for some \n print $text;