in reply to Dumping hash of hashes to file and back
What part of the Data::Dumper manual page is unclear?
write:
use Data::Dumper; my %h = ( foo => 1, bar => { quux => 2, frob => 3, }, ); open my $fh, '>', 'hash.pl' or die "nope: $!"; print $fh Dumper(\%h); close $fh or die "fasten seat belts. Last orders: $!";
retrieve:
my %h = %{ require 'hash.pl' }; die "read hash dinn' work: $@" if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dumping hash of hashes to file and back
by Herkum (Parson) on Jun 18, 2009 at 05:34 UTC | |
by ELISHEVA (Prior) on Jun 18, 2009 at 06:04 UTC | |
by shmem (Chancellor) on Jun 18, 2009 at 07:09 UTC |