Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Compare two arrays for uniqueness

by Laurent_R (Monsignor)
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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-28 22:08 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls