# Perl: Comparing Arrays



## Skawt (Aug 21, 2007)

Hi guys

With perl, how can I compare every item in one array to every item in another array, looking to see if any of them match? I can't work it out.

Say there's an array called @numbers1 with 10 different numbers in it, and another array called @numbers2 with 20 different numbers in it, how do I make a loop to find if the same number exists in both arrays, and print a message accordingly?


----------

