Challenge: Sometimes we want to know in which of several lists one or more items can be found.
Response: Two new methods: is_member_which()
and are_members_which()
.
@memb_arr = $lcm->is_member_which('golfer');
# @memb_arr will hold: ( 0, 1, 2 )
$memb_hash_ref = $lcm->are_members_which(
[ qw| abel baker fargo hilton zebra | ] );
# $memb_hash_ref will be:
{
abel => [ 0 ],
baker => [ 0, 1 ],
fargo => [ 0, 1, 2, 3, 4 ],
hilton => [ 1, 2 ],
zebra => [ ],
};
Previous | Back to start of show | Next |
Slide: 10 these_those | © 2004-18 James E. Keenan |