$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } )); # NAME_lc = lower case column name # so it's equal to \@row{\@region} (and \@row{\@sales}) # binds \$row{region} much as it would \$region while($sth->fetch) { # sets $row{region} with region's data # does same with sales print "$row{region}, $row{sales}\n"; # since this is rebinded each time %row is overwritten }