in reply to Re: Pass by value acts like pass by reference
in thread Pass by value acts like pass by reference
When you flatten a hash you are getting a shallow copy of the hash, not a deep copy. To get a deep copy you need to use some form of serialization mechanism to do it. Storable will probably be your best bet in terms of speed and memory consumption. Of course,it may be a lot easier to just change your algorithm to not corrupt the original arrays....
First they ignore you, then they laugh at you, then they fight you, then you win.
In Section Seekers of Perl Wisdom