http://www.perlmonks.org?node_id=912055


in reply to How can we compare two hashed with each other for case insensitive data?

If case really doesn't matter, then the best solution is to just initialize the values with lc.

However, you can also set the values to lc after the fact as well:

lcvalues(@array1); lcvalues(@array2); sub lcvalues { for (@_) { if (ref $_ eq 'HASH') { lcvalues(values %$_); } elsif (ref $_ eq 'ARRAY') { lcvalues(@$_); } elsif (ref $_) { warn "Unknown data type: " . ref $_; } else { $_ = lc $_; } } }