http://qs321.pair.com?node_id=1161711


in reply to Print keys corresponding to duplicate values

As FreeBeerReekingMonk suggests, the %seen style of hash is often used for counting duplicates:
my %seen; $seen{$_}++ for values %hash; my @dups = grep { $seen{ $hash{$_} } > 1 } keys %hash; print join(',', sort @dups );