in reply to array difference

One easy way to do it is to use a hash:
my %tmp; @tmp{@b} = (); delete @tmp{@a}; @result = keys %tmp;
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.

Update: Sheesh, I guess I'm a little slow at writing nodes. I swear those first two replies weren't there before :)