in reply to Clarify I want to discard the set of elements if there are any duplicates.

another way:
@rray=(1,2,2,3,3,3,4,4,4,4); for(@rray) { $seen{$_}++; } @nodups=keys %seen; print "@nodups\n";
The down side is that it looses original order.

Originally posted as a Categorized Answer.

  • Comment on Re: Clarify I want to discard the set of elements if there are any duplicates.
  • Download Code