in reply to bullet proof SLURP file
What is [a] way to read file and fail on any erorrs?
If you don't need fancy error messages, how about autodie? It's lexical, so it can be used in the narrowest possible scope, globally, etc. E.g. (untested):
my $filename = '...'; ... my $whole_nine_yards = do { use autodie; open my $fh, '<', $filename; local $/; <$fh>; };
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: bullet proof SLURP file
by haukex (Archbishop) on Jan 09, 2018 at 21:40 UTC |