sub count_unique { my @array = @_; my %count; map { $count{$_}++ } @array;