$hash{$_}++ for @array; %hash=reverse %hash; for (keys %hash) { $max = $_ > $max ? $_ : $max }; print $hash{$max}, "\n";