Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Pair of items

by tadman (Prior)
on Jul 29, 2003 at 20:14 UTC ( [id://278966]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://278966]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found