in reply to Trouble with array of arrays

Hi trew,

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; }