my $text = do { local $/; open my $fh, '<', 'filename' or die "Error opening filename for read - $!"; <$fh> };