http://qs1969.pair.com?node_id=278966


in reply to Re: Pair of items
in thread Pair of items

Tweakism to get something like this:
sub is_ok { my ($x, $y) = @_; my %x; @x{@$x} = 1; return !grep { exists($x{$_}) } @$y; }
You seem to create a hash and then just iterate over its keys, instead of just using the straight list. Here I just make one hash and use the other list raw.

grep is used to produce a list of matches, which is then negated, so that it returns a true value if there are no matches.