note
kutsu
<p>Alternatively you can use bind_columns to do this (except row by row instead of all at once). From the [http://search.cpan.org/~timb/DBI-1.48/DBI.pm#bind_columns|docs] (prepare something like "select region, sales from table"):</p>
<code>
$sth->execute;
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
while ($sth->fetch) {
print "$row{region}: $row{sales}\n";
}
</code>
<p><b>Updated:</b> Added better reference to documentation</p>
<div class="pmsig"><div class="pmsig-261960">
<p><i>"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am."</i> Ambrose Bierce</p>
</div></div>
461017
461024