in reply to Comparing two hashes for duplicate keys with no case sensitivity
TIMTOWTDI
This is similar to jethro's second solution but using map and grep instead of loops. And I made his lchash (matcher here) a local variable so that it's gone when the loop is done.my %hash1 = ("TEXT", 25,"test",26,"tset",27); my %hash2 = ("text", 25,"TeSt",24,"xyz",23); foreach (do { my %matcher; @matcher{map lc,keys %hash1}=(); grep exists $matcher{lc $_},keys %hash2; }) { print "$_ matches\n"; }
|
|---|