http://qs1969.pair.com?node_id=1217198


in reply to Any downsides to this slurp idiom?

If you don't mind spending a few more bytes, then I'd always include the file name in the message:

my $data = do { open my $fh, '<', $file or die "'$file': $!"; local $/; <$fh> };