Is there a module which can do this more nicely (not only replacing the smart-matching part)?
#!/usr/bin/env perl
use warnings;
use 5.014;
my @array_all = ( qw( one two three four ) );
my @array_part = ( qw( two four six ) );
my @temp;
for my $i ( @array_part ) {
push @temp, $i if not $i ~~ @array_all;
}
# if ( @temp ) { do something );
You are looking for the set difference or perhaps the relative complement, the example is ambiguous. Any of the numerous set modules will suffice.