my $sth = $dbh->prepare( "SELECT foo, bar, ni from some_table" ); $sth->execute; my %row; $sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } )); while ($sth->fetch) { print "foo = $row{foo}, bar = $row{bar}, ni = $row{ni}\n"; }