Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Create unique array --the hard way!

by hazylife (Monk)
on Mar 07, 2014 at 16:01 UTC ( #1077407=note: print w/replies, xml ) Need Help??


in reply to Create unique array --the hard way!

foreach my $elem (@sorted) { push @uniq, $elem if !@uniq || $elem ne $uniq[-1]; } # OR my @uniq = shift @sorted; $uniq[-1] ne $_ && push @uniq, $_ for @sorted;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1077407]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-08-13 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (68 votes). Check out past polls.

    Notices?