If the order of the arrays makes no difference, it sounds like you are looking for an intersection operator of some sort. Array::Utils might have what you are looking for. I found this by searching metacpan for "union intersect".
Otherwise, a method to find them is pretty straightforward:
@hash1{@array1} = (1)x@array1
push( @intersection, grep { $hash1{$_} } @array2 );
Updates:
--MidLifeXis
In reply to Re: Logical operations on arrays
by MidLifeXis
in thread Logical operations on arrays
by ronmrdechai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |