my %count; for (@items) { $count{$_}++ } my @dups = grep { $count{$_} > 1 } @items;