Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Checking a hash for two matching values.

by farang (Chaplain)
on Sep 17, 2013 at 19:11 UTC ( #1054522=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Checking a hash for two matching values.
in thread Checking a hash for two matching values.

It's easy enough to add case insensitivity to NetWallah's code with fc or lc.

For v5.16 or newer:

use v5.16; ... my @found= grep { my %r = reverse map fc, %$_; exists $r{cat} && exists $r{dog} } @pets;
For older versions as well:
my @found= grep { my %r = reverse map lc, %$_; exists $r{cat} && exists $r{dog} } @pets;


Comment on Re^3: Checking a hash for two matching values.
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-01-26 13:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (190 votes), past polls