http://www.perlmonks.org?node_id=1067294


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;