http://www.perlmonks.org?node_id=1011420


in reply to Copy of multidimensional hash

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