Jim Green wrote:
> i have a question for the following perl code,  by changing the value
> in %h3, the script also changes the value for %h4, I vaguely
> understand it is because %h3's key is reference to %h2, %h2's key is
> reference to %h1,
> 
> so by changing value in %h3, the script also changes the value for %h4,
> I was wondering if there is a way to address this problem, I don't
> want by changing $h3{k3}{k2}{k1} = "v2", %h4 also got changed.
> 
> Thank you list for any pointers, I am absolute newbie and I am learning..     

See `perldoc Storable` and search for /dclone/

Also, to see inside a complex data structure, see `perldoc Data::Dumper`
as in:

print Dumper \%h1, \%h2, \%h3, \%h4;


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to