in reply to Comparing two arrays

your grep statement needs to first filter out duplicates in @string2, before assigning to @intersection_of_the_2_arrays.

You could do this by using a statement similar to your first map.

     "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken