Ed Moon wrote:
>
> Can anyone post an example of the use of Data::Dumper with a complex data
> structure?
>
> I've gone through the docs but I don't understand how I'd save and then
> later restore a complex data structure (in my case a hash of array of
> hashes).
use Data::Dumper;
my %hoah = ( a => [ { b => 123, c => 345 }, { d => 456 } ] );
my $stringRep = Data::Dumper->Dump( [ \%hoah ], [ qw( $hashRef ) ] );
eval $stringRep;
# now %$hashRef is a copy of %hoah.
print $stringRep, "\n";
print Data::Dumper->Dump( [ $hashRef ], [ qw( $hashRef ) ] ), "\n";
--
Ned Konz
currently: Stanwood, WA
email: [EMAIL PROTECTED]
homepage: http://bike-nomad.com, Perl homepage:
http://bike-nomad.com/perl
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]