But this assumes you don't care about the result being in the same order as @b. If @b is already sorted, you can get around that by throwing a sort in front of keys %tmp, though this is somewhat wasteful.my %tmp; @tmp{@b} = (); delete @tmp{@a}; @result = keys %tmp;
Update: Sheesh, I guess I'm a little slow at writing nodes. I swear those first two replies weren't there before :)
In reply to Re: array difference
by Errto
in thread array difference
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |