in reply to Re: Populating a nested hash with itself?
in thread Populating a nested hash with itself?

The output of Data::Dumper is not guaranteed to properly evaluate and reconstruct the data, unless you set $Data::Dumper::Purity = 1. It is still possible to confuse Data::Dumper in some cases, but with Purity, it'll handle most self-referential and other cyclical structures. The output with this configuration:
$VAR1 = { 'k1' => { 'k11' => [ 'v1', 'v2' ], 'k12' => 'w00t!' }, 'k2' => { 'k21' => 'what?', 'k22' => [] } }; $VAR1->{'k2'}{'k22'} = $VAR1->{'k1'}{'k11'};
As you can see, Data::Dumper now produces Perl code, and not merely a Perl-like syntax to describe the data.

--
[ e d @ h a l l e y . c c ]