Looking for somethings like this? The List::Utils may also have a method for strings
#!/usr/bin/perl use strict; use warnings; my @strings = qw( QS DD DFD SD QS QS QS DD DFS); my %count; $count{ $_ }++ for @strings; my @sorted = (sort {$count{$a} cmp $count{$b}} keys %count); print pop @sorted, "\n";
In reply to Re: find maximum occuring element in a array
by zentara
in thread find maximum occuring element in a array
by capriguy84
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |