Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Compare two arrays for uniqueness

by Laurent_R (Prior)
on Dec 16, 2013 at 07:13 UTC ( #1067294=note: print w/ replies, xml ) Need Help??


in reply to Compare two arrays for uniqueness

List::Compare is the way to go; however, assuming you wanted to do it manually yourself, there are two possibilities: to sort the arrays and then compare the elements one by one, or, better in most cases, to store one array in a hash and then check for elements of the other array that are in the hash;


Comment on Re: Compare two arrays for uniqueness

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2015-07-03 06:14 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 (48 votes), past polls