http://qs321.pair.com?node_id=430494


in reply to Perl/MySQL

You'll find it easier to user fetchrow_hashref for this purpose, like this:
while ($row=$sth->fetchrow_hashref) { foreach $col (%{$row}) { print "$col: ".$$row{$col}."\n"; } }
Edit: I made a stupid mistake: it should be
foreach $col (keys %{$row}) {