my $content = ''; open my $fh, "foo" or die $!; { local $/; $content = <$fh>; } close $fh;