in reply to Building an array of hashes from database

You are always pushing a reference to the same %data hash. The easiest way around this is to do:
push(@records, {%data});
which creates a reference to a new hash each time around.

Alternatively, put my %data inside the while (fetchrow_array()) loop - this will also create a new hash each time through the loop.

Michael