in reply to searching 2 arrays

I think you should take a look at List::Compare.