in reply to Multiple references pointing to the same memory location

If you have too many keys for an IN clause, then you may as well fetch an array since thats what you're saving. Also, if you're only fetching one row, you should call $sth->finish, though the following shouldn't be any different (implicitly calling finish when done) if only one row exists for each key:
foreach my $key (@keys) { # You are using 'RaiseError', right? $sth->execute($key); while (my @temp_columns = $sth->fetchrow_array) { push(@entries, \@temp_columns); } }
Update:I see DBX had mostly the same answer. Oh well, it was a good answer, and worth repeating :)