in reply to Re: Using Data::Dumper to dump an array of hashes to a file
in thread Using Data::Dumper to dump an array of hashes to a file
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using Data::Dumper to dump an array of hashes to a file
by kyle (Abbot) on Aug 15, 2008 at 01:21 UTC | |
by alexm (Chaplain) on Aug 15, 2008 at 07:47 UTC |