Aside from the question of how suitable the items in @list are for your purposes, the logic in read_line's loop doesn't make sense to me. I think that what you want is:
foreach my $word (@list) { print $word, $/ unless $hash{ lc $word }++; $count = $hash{ lc $word }; if ($count > $maxcount) { $maxcount = $count; $find = $word; } }
the lowliest monk
In reply to Re: using hash to find frequency count
by tlm
in thread using hash to find frequency count
by jjohhn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |