Hope it helps.my $i = 0; my $a = 'match_this' foreach my $b (@array) { if ($a eq $b) { $i++ } } print "Total occorunces of $a: $i";
In reply to Re: array counting
by sschneid
in thread How can I count and display unique items in an array? (was: array counting)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |