in reply to finding unique elements in an array

Update: As aragorn pointed out that's wrong answer

Here is my way to do it:

@hash{@array} = @array; @onlyonce = keys %hash; print "@onlyonce";

Replies are listed 'Best First'.
Re: Re: finding unique elements in an array
by Aragorn (Curate) on Apr 02, 2003 at 08:29 UTC
    Although your solution uniqifies the elements of the array, it isn't possible to tell the number of times an element appears in the original array, which apparently is required.

    Arjen

      Hmm. I really can not find that requirement.
        only those array elements that appears once (and not twice or more...)
        Maybe I'm reading it totally wrong, but it seems to me that he wants only the elements that occur once in the array.

        Arjen