in reply to Is this too clever? (or, stupid DBI tricks)

Why use dereferencing when you have bind_columns ()

my ($sth, $sum) = ($dbh->prepare ("select sum (whatever) from ...")); $sth->bind_columns (\$sum); while ( long running loop ) { if ($sth->execute and $sth->fetch) { # My $sum is now valid } else { print STDERR "Something went wrong: ", $sth->errstr, "\n"; } }

Enjoy, Have FUN! H.Merijn