in reply to DBI help, aka confused newbie

Personaly, I dislike using the foreach here - I feel the while works better:
while ($ref=$sth->fetchrow_hashref) {
Now, since I have a reference to a hash, I can simply access each element by name: $$ref{foo} for foo, etc.