my %rec; my $sth = $dbh->prepare ("select * from foo"); $sth->execute; $sth->bind_columns (\@rec{@{$sth->{NAME_lc}}}); while ($sth->fetch) { print "foo.c_foo = $rec{c_foo}\n"; }