...so that I can then compare this new array with a third array and repeat the process
To determine what elements are common to a set of arrays you should use hashes, since that is the mechanism best suited to checking if values have previously been encountered.
$h{$_}++ for (@array1,@array2); @common_elements = grep {$h{$_} > 1} keys %h; print "@common_elements";
With a little imagination you could make this generic to operate on N arrays, not just two.
In reply to Re: comparing arrays
by EdwardG
in thread comparing arrays
by Becky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |