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


in reply to Get All Duplicated Elements in an Array (Once, without shifting)

Maybe I'm missing something, but...
for(@in){ $hash{$_}++; } foreach my $key (keys %hash){ print "$key is lonely\n" if ($hash{$key} == 1); print "$key has friends\n" if ($hash{$key} != 1); }

thor

Update: changed %hash{$_}++ to $hash{$_}++ to make it correct.