$hash{$_}++ foreach @array; foreach keys %hash { $max = $_ if $hash{$_} > $hash{$max} }; print $max, "\n";