in reply to changing copy of a hash changes original
This is the difference between a so-called “shallow copy” and a “deep” one. Perl has the concept of references, which are scalar-things which “refer to” other things. (This is, by the way, how Perl appears to have “multi-dimensional,” even arbitrary, data-structures given that it actually only has scalars, lists, arrays, and hashes.) It is easy to “copy” something such that what you’re actually doing is creating a structure of references to the original thing ... easy, memory-efficient, and it usually works great. This is a “shallow” copy.