Think about Loose Coupling | |
PerlMonks |
Re: How can I find the union/difference/intersection of two arrays?by Dev Null (Acolyte) |
on Jun 07, 2017 at 15:56 UTC ( [id://1192290]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|