And this is to check.@a= qw(a b c d e c d e c d e c d e c d e a b c d a b c d a b c d a b c + d a b a b a e e d a a a a a a a a); for(@a) { if ($c<$r{$_}++) { $m=$_; $c=$r{$_} } }
Hopesfor (keys %r){print "$_ $r{$_}\n"}; print "\n\$m is $m\n\$c is $c";
In reply to Re: Re: Re: finding the most popular in array
by Anonymous Monk
in thread finding the most popular in array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |