$sth->execute(); my @columns = $sth->{NAME_uc}; my %row; $sth->bind_columns( \@row{@columns} ); while ( $sth->fetch() ) { ... }