- or download this
my %order;
while ( my $rec = $data->fetchrow_hashref ) {
push @{ $result{ $rec->{"ID"} } }, $rec->{"item"};
push @order, $rec->{ID}; # read order
}
- or download this
my $last = $order[0]; # first key
...
compare($last,$cur);
$last = $cur; # keep current
+as last
}
- or download this
sub compare {
my ($previous,$present) = @_;
...
}