in reply to loop though query results twice
my @rows; while (my $row = $sth->fetch()) { push @rows, [ @$row ]; ... } for my $row (@rows) { ... } [download]
[ Me bad. I pretty much only read the title ]