|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re: Shallow vs deep copy (Was Re^3: hash ref mind blow)by Anonymous Monk |
| on Sep 25, 2008 at 15:38 UTC ( [id://713667]=note: print w/replies, xml ) | Need Help?? |
|
Yeah, I thought that %{ _ref_ } created an alias, but now I've learned it just shallow copies the struct.
It's coincidental, but everytime I used it as reference passed to subs, I added subkeys and everything worked as an alias. To my surprise, when I added a root key to %copy and it didn't change %hash my world came tumbling down. So it's back to $$copy->{key} stuff, as
Looks so unscoped to my personal perl taste. And Data::Alias will not cpan into my Strawberry perl, complaining about requiring perl 5.8.9 on Win32... BTW ikegami, wow! Now... I want to know what package does those hash textgraphs you posted. Cos Data::Dumper doesn't get even close to that kind of representation!
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||