|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Putting an array into a hash gives an unexpected reference to the hash itself.by Perlbotics (Monsignor) |
| on Nov 07, 2012 at 23:29 UTC ( #1002769=note: print w/ replies, xml ) | Need Help?? |
|
Sure, they are the same. You assigned the same reference twice. If you want two different copies, use two different references. E.g. the original \@maintainers and a copy [ @maintainers ] or two new copies.
One more thing. I was creating a shallow copy in the example above. For more complex data structures, you might need to copy recursively or use something like Storable::dclone or Clone.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||