http://www.perlmonks.org?node_id=461078


in reply to Re: fetchrow_array
in thread fetchrow_array

Alternatively you can use bind_columns to do this (except row by row instead of all at once). From the docs (prepare something like "select region, sales from table"):

$sth->execute; my %row; $sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } )); while ($sth->fetch) { print "$row{region}: $row{sales}\n"; }

Updated: Added better reference to documentation

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce