in reply to
Extracting elements in one array but not in another
To find elements that are in one array but not in another, there is a nice loopless solution from the Perl Cookbook which uses the delete function:
my %seen;
@seen{ @original_1 } = ();
delete @seen{ @original_2 };
my @original_1_only = keys %seen;
Of course there is also a loopy solution, should you prefer it:
my %seen;
my @original_1_only;
@seen{ @original_2 } = ();
foreach (@original_1) {
push(@original_1_only, $_) unless exists $seen{$_};
};
Stick with these.
Ciao,
Emanuele.