in reply to How Do I Compare Array A to Array B, removing B elements from A.
I don't know if it's a typo or a change in how Perl handles the expression. I figure this note will help save someone fifteen minutes of frustration.my @ArrayC = map { my $x = $_; (grep { $x =~ /^$_/ } @ArrayB) ? () : $x } @ArrayA;
Originally posted as a Categorized Answer.
|
|---|