sub is_ok { my ($x, $y) = @_; my (%x, %y); @x{@$x} = 1; @y{@$y} = 1; foreach my $k (keys %x) { return 0 if exists $y{$k}; } return 1; }