sub in { my ( $file ) = @_; open my $fh, '<', $file or die "Can't read '$file': $!"; local $/ = undef; # read whole file my $dumped = <$fh>; close $fh or die "Can't close '$file': $!"; return @{ eval $dumped }; }
Wouldn't do or require accomplish just the same task, but more succinctly?
In reply to Re^2: Using Data::Dumper to dump an array of hashes to a file
by alexm
in thread Using Data::Dumper to dump an array of hashes to a file
by wishartz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |