my $sth = $dbh->prepare(q{ SELECT Table_PK, Name ... }); $sth->execute; my %lookup = map { $_->[0], $_->[1] } @{ $sth->fetchall_arrayref };