Subject: | [PATCH] foundin, notin functions |
# Find items in @B that are in @A
sub foundin (\@\@) {
my ($A, $B) = @_;
return grep { my $i = $_; any { $i eq $_ } @$A; } @$B;
}
# Find items in @B that are not in @A
sub notin (\@\@) {
my ($A, $B) = @_;
return grep { my $i = $_; none { $i eq $_ } @$A; } @$B;
}
Not sure if there are some better optimizations for these, but that's
about as far as I can see. The XS part will need to be filled in, too.