in reply to Storable.pm: Storing Multi-dimensional Hashes How?

As another method, Data::Dumper works quite well in my shop and we are regularly storing very complex data structures. It works something like this, where $donor is a reference to a complex structure
sub Clone { my $donor = shift; my $file = shift; my ( $dna, $clone ); local $Data::Dumper::Indent = 0; # It will be eval'd, we don't n +eed pretty local $Data::Dumper::Purity = 1; # make sure all code is present local $Data::Dumper::Terse = 1; # makes the eval work well local $Data::Dumper::Deepcopy = 1; # tell Dumper our intent #--- # Interestingly enough, Dumper will embed the call to bless in the + DNA. # Which makes this whole analogy really quite accurate and somehow + strange #--- $dna = Dumper( $donor ); #--- # At this point, the data structure in $donor is stringified # into $dna. $dna can be written to file or whatever. # To get it back out, do something like what follows - # this is a cloning function, after all. #--- $clone = eval $dna; return $clone; }
mikfire