( my $text = do { local $/, @ARGV = 'foo.txt'; <> } ) =~ s/\n+//g;