Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Compare two arrays for uniqueness

by Laurent_R (Abbot)
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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067294]
help
Chatterbox?
[GotToBTru]: set -o vi works in shell command line, but debugger doesn't recognize backspace or arrow keys

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-07-26 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (396 votes). Check out past polls.