in reply to Get All Duplicated Elements in an Array (Once, without shifting)
my @result = do { my %counter; grep ++$counter{$_} == 2, @input; }; [download]
-- Randal L. Schwartz, Perl hacker