Well, if you don't care about memory consumption, you can always create all the groups first
my @group; while (my $row = $sth->fetchrow_hashref) { push @group, [] if !@group || $row->{foo_id} == $group[-1][0]{foo_id}; push @{$group[-1]}, $row; } process($_) for (@group);
In reply to Re^3: DBI & processing groups of rows
by wind
in thread DBI & processing groups of rows
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |