in reply to Re^2: Insert into element into arrays ref
in thread Insert into element into arrays ref

You are merging the hash in $data2 with each of the hashes in $data1. Read the FAQ.
perldoc -q "How do I merge two hashes?"
Bill