my $sth = $dbh->prepare(q{ SELECT Table_PK, Name ... }); $sth->execute; my %lookup = map { $_->[0], $_->[1] } @{ $sth->fetchall_arrayref }; #### $sth->bind_columns( map { undef ${$_}; \${$_}; } @{ $sth->{NAME_lc} } ); while($sth->fetch) { print("$table_pk\t$name\n"); }