@array = ('bent', 'svend', 'gert','pete','svend','pete'); map($hash{$_}++, @array); print join(' ',map($_.':'.$hash{$_}, sort {$hash{$a}<=>$hash{$b}} keys %hash));