http://www.perlmonks.org?node_id=986539


in reply to Pushing values into an array of hashes

I think you'll find the problem is you're pushing a reference to %rec to your @DA each time, but you only have one instance of %rec, i.e. all your references point to the same thing.

So if you move the definition of %rec inside the loop it should do what you want.

So something like this

for (@buckets) { my %rec; ... push @DA,\%rec; }