in reply to most efficient way to implement "A without B"
A hash is the usual way to improve the efficiency of lookup.
No sorting needed.my @a_not_b = do { my %b; @b{@b} = (); grep { not exists $b{$_} } @a; };
After Compline,
Zaxo
|
---|
In Section
Seekers of Perl Wisdom