Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Compare two arrays for uniqueness

by Laurent_R (Parson)
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 imbibing at the Monastery: (5)
As of 2014-08-31 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls