http://qs1969.pair.com?node_id=871536


in reply to Ignore Case when comparing Hash Keys

First transform one of the hashes to use all lowercase keys. Then check existence of lc $other_key.

Here's a Perl 6 solution:

my %lc1 = %hash1.keys>>.lc Z %hash1.values; for %hash2.keys -> $k { say "$k ", %lc1.exists($k) ?? 'Matched' !! 'Did not match'; }

Transforming the code to Perl 5 shouldn't be too hard.