This is inefficient, but I use it for intersection when I know I'm guaranteed small list sizes, and it's more valuable / pleasing to me to have a one-line solution:
my @isect = map { my $b = $_; grep { $_ eq $b } @a } @b;In reply to Re: How can I find the union/difference/intersection of two arrays?
by Dev Null
in thread How can I find the union/difference/intersection of two arrays?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |