in reply to Multiple references pointing to the same memory location

You could probably avoid extra steps by taking an actual array and then referencing it, rather than doing 'ref-deref-ref':

for my $key (@keys) { $sth->execute($key); my @columns = $sth->fetchrow(); push(@entries, \@columns); }
Without having seen anymore of your code, it also looks like you might want to bind some variables. Anytime you are iterating over an execute statement, binding is usually the way to go rather than rebuilding and repreparing with different variables.