in reply to Find unique elements in an array

Not that it is any different in the manner that it works, but I've always preferred:
my @uniquelist = keys %{{map {$_=>1} @nonuniquelist}};
An anonomous hash makes it much more compact.
------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re: Re: Find unique elements in an array
by BrowserUk (Patriarch) on Apr 05, 2004 at 03:09 UTC

    It's compact, but far and away the slowest method.

    However, you can combine elements of yours with tilly's performance trick and get something that is both fairly compact and almost as quick.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail