my %oc; for (0 .. $#sequence) { $oc{$sequence[$_]}[0] += $numbers[$_]; ++$oc{$sequence[$_]}[1]; } foreach my $seq (keys %oc) { print "The average for $seq is ".($oc{$seq}[0] / $oc{$seq}[1]).$/; }
Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")
Don't fool yourself.In reply to Re^3: finding matches in the same array
by polettix
in thread finding matches in the same array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |