What kyle said: "Consider using YAML or Storable instead since it doesn't have the possibility of executing things if someone hostile gets a hold of the dump file."
The YAML is more terse too. Storable is very fast and nice but it has some caveats and isn't always portable (though nstore can help) or compatible with version changes.
use strict; use warnings; use YAML qw( DumpFile LoadFile ); my @aoh = ( { a => 1 } ); my $file = 'diskstats.perldata'; DumpFile( $file, \@aoh ); my $reconstituted = LoadFile($file); # check it out in Data::Dumper style- use Data::Dumper; print Dumper $reconstituted;
In reply to Re: Using Data::Dumper to dump an array of hashes to a file
by Your Mother
in thread Using Data::Dumper to dump an array of hashes to a file
by wishartz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |