Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using grep for many-to-many relationships

by Moron (Curate)
on Jul 02, 2007 at 11:49 UTC ( #624417=note: print w/replies, xml ) Need Help??


in reply to Using grep for many-to-many relationships

my @availablePosts = grep { for my $enemy( keys %$_ ) { if ( !defined( $player{ $enemy }) || ( $player{ $enemy } < $_ +-> { $enemy } ) ) { $_ = undef(); last; } } } @posts;
(untested)
__________________________________________________________________________________

^M Free your mind!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://624417]
help
Chatterbox?
marioroy concurrent Tie::File among many workers is possible via MCE::Shared.
marioroy Ditto for DB_File, BerkeleyDB, etc. ;-)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2017-08-18 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (296 votes). Check out past polls.

    Notices?