I'd agree with using grep, though I'd use a hash rather than a regexp.
my @array_1 = qw( x y z ) ; my @array_2 = qw( v w x ) ; my %base = map { $_ => 1 } @array_1 ; my @intersection = grep { $base{$_} } @array_2 ;
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
In reply to Re: Comparing Arrays -> storing results in a third Array
by DamnDirtyApe
in thread Comparing Arrays -> storing results in a third Array
by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |