in reply to Count of words that match in an array
perlfaq4 also has an answer, if the elements of each array are unique. See How do I compute the intersection of two arrays?