in reply to Trying to access array of arrays
I need to access elements 8959, 10710, 10710 to find their distinct count.
To help you, it would be helpful if you posted the code which populates the array @result. This array holds array references, whose first element is the thing you are looking looking for to get the distinct count, right? Well, use them as key to a hash and sum them up:
my %distinct; for my $aref ( @result ) { $distinct{$aref->[0]}++; } print Dumper(\%distinct);
|
|---|