Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm using Data::DumpXML to dump a complex data strcuture to XML, and when I restore it with Data::DumpXML::Parser its returning a reference to an array.
I've tried deferencing it by:
my $newds = @{$new} Data::DumXML::Parser output # NEW DATA STRUCTURE WITH ARRAY REF $VAR1 = [ bless( { 'tree' => { 'aggregatePsExtentTable' => { '1' => 'aggregatePsExtentEntry' Data::Dumper output # ORIGINAL DATA STRUCTURE $VAR1 = bless( { 'tree' => { 'aggregatePsExtentEntry' => { '1' => 'aggPsExtentIndex',
How can I grab the array ref so it's like the original? This should be simple

Replies are listed 'Best First'.
Re: Restoring a DataStructure ??
by kvale (Monsignor) on May 17, 2004 at 20:08 UTC
    You are are correct in that you need to dereference. In this case, the original data structure is contained in the first element of an anonymous array, so
    my $dumper = $parser->[0];
    extracts the data structure you want.

    -Mark