how do I find if at least one of many keys in a list is in a hash (quick, fast, and simple)
Dunno if this meets *all* of your criteria, but I find this simple enough:
my @search_keys = qw(one two three); my %hash = ( four=>4, five=>5, six=>6); my $foundit =0; foreach (@search_keys) { if (exists $hash{$_}) { $foundit =1; print "found an entry for $_ in %hash!\n"; } }
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: Re: Hash slices ?
by arturo
in thread Hash slices ?
by ChOas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |