# make temporary hash using lower case keys only # hash allows for fast lookup of matching key later on in # our for loop my %hashLowercaseKeys1 = ( map { lc($_) => 1 } keys %hash1 ); foreach my $k (keys %hash2) { if (exists $hashLowercaseKeys1{lc($k)}) { print "$k: matched\n"; } else { print "$k: no match\n"; } }