in reply to Re: Re: Eliminate duplicate and original values
in thread Eliminate duplicate and original values

From RE: Return a Unique Array by sergio via Perl Cookbook:
@array = grep { ! $seen{$_}++ } @array ;

--Jim

Update:

Oops! Sorry, this doesn't eliminate the duplicated values.

Replies are listed 'Best First'.
Re: Re: Re: Re: Eliminate duplicate and original values
by data64 (Chaplain) on Nov 26, 2001 at 00:24 UTC
    This does not eliminate the duplicate elements. See the requirements in the root node.
    If the original array contains A1, B2, C3, C3, D4, then the output should contain A1, B2, D4.
    C3 should not be included.
    That's a very clever way of obtaining unique values though and will get copied in other places, if you don't mind. :)