Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Pair of items

by tadman (Prior)
on Jul 29, 2003 at 20:14 UTC ( #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? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2023-01-29 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?