Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

RE: Return a Unique Array

by sergio (Sexton)
on Feb 25, 2000 at 19:44 UTC ( #4395=note: print w/ replies, xml ) Need Help??


in reply to Return a Unique Array

GrassHopper! Always read the books. In the Perl Cookbook you can find


my %seen =() ;
@unique_array = grep { ! $seen{$_}++ } @non_unique_array ;

Which makes the soul happier!


Comment on RE: Return a Unique Array

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-07-06 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls