Multi-dimensional data structures in Perl use references. Each of your hash keys indexes a value. That value is a reference to an anonymous array. When you copy the hashes, the new one still holds the same references, to the same anonymous arrays.
You want to look at Storable's dclone() function: It makes a deep recursive copy of the values rather than a shallow copy of the references.
Dave
In reply to Re: Copy of multidimensional hash
by davido
in thread Copy of multidimensional hash
by tommaso.fornaciari
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |