You can use refs instead of copying arrays, and hashes to make the code more readable for humans.
The code below is syntactically correct but not tested.
use Data:Dumper; ... while (my $event = $sth->fetchrow_hashref()) { push @recordset, $event; }; $sth->finish; for (my $i=0; $i<@recordset; $i++) { if ($recordset[$i]->{DIRECTION} eq "exit") { for (my $j=$i+1; $j<@recordset; $j++) { if ($recordset[$i]->{OCR} == $recordset[$j]->{OCR}) { undef $recordset[$j]; } } undef $recordset[$i]; } } for my $row ( @recordset ) { print Dumper($row) . "\n" if defined $row; }
In reply to Re: Trouble with array of arrays
by pme
in thread Trouble with array of arrays
by trew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |