It might be more efficient (depending on the sizes of the 2 arrays) to make a hash from one to do a quick lookup:
my %HashB = map { ($_ => 1) } @ArrayB; @ArrayA = grep { $HashB{$_} } @ArrayA;
-ben
Originally posted as a Categorized Answer.
In reply to Re: How Do I Compare Array A to Array B, removing B elements from A.
by knobunc
in thread How Do I Compare Array A to Array B, removing B elements from A.
by fuzzball
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |