#!/usr/bin/perl use strict; use warnings; my %hash; %hash = map { $_ => ++$hash{ $_ } } (split ' ', ); for (sort { $hash{$b} <=> $hash{$a} } keys %hash) { print "$_ => $hash{ $_ }\n"; last; } __DATA__ 2 3 3 3 5 7 8 12 32 44 55 12 3 23 43 33 1 4 25 43 42 1 4 5 3 3 3