in reply to Hash is appending old and new data

In a hash, Keys are what that is unique. Not the values.

Some of the nodes which may give insights related to your query.

  • Adding or removing keys while iterating over a hash
  • Changing the keys of hashes in arrays
  • Multiple identical keys in a hash.