in reply to Array of dynamic Hash how to preserve the values
It's easy to become “lost” when you start trying to build complex data-structures in Perl. Specifically, you can lose sight of what is actually occurring, i.e. “according to Perl,” just because “it seems to work okay.”
Remember this always: an array, like its half-brother the hash, always contains one thing per “bucket.” That one thing can be ... a scalar, undef, or a reference to something else.
So, you can never really have “an array of hashes.” What you've actually got is “an array of hash-refs.”
When you, unintentionally or otherwise, push through “a reference to something else,” where you wind up is that “something else.” Perl's syntax rules are pretty darned generous, and you can easily wind up thinking that you are telling Perl one thing, but Perl is interpreting it as another thing, and it appears to be “working.” The difference is subtle, and extremely important, but not at all obvious.