you could try something like this
for(my $i=0;$i< scalar(@aoa);$i++) {
for(my $x=0;$x < scalar($aoa
$i);$x++) {
$hash{$i} = $hash{$i} + $aoa
$i$x;
}
}
my @res = ();
foreach my $key (sort keys %hash) {
push(@res,(($hash{$key}) / 4));
}
If you don't know the length of the aoa then you could make the '4' in '/ 4' into a var. Or you could do a hash that has more of a struct feel to it like:
$hash{$i}{'total'} = <total of the one column of values>
$hash{$i}{'array_length'} = #
Not sure how much faster this would be than what you have, but it should be fairly fast since you only go through the array of arrays once and then compute the average once.
George in NC