my @mixedcasekeys = ('ABC', 'foo', 'ExAbbrev'); sub value { return "This is the value for $_\n"; } my %hash; for (@mixedcasekeys) { $hash{lc $_} = [$_, value($_)]; } showkeys(); print "Adding key: 'Foo'\n"; $hash{lc 'Foo'} = ['Foo', value('Foo')]; showkeys(); print "Looping over the keys and showing the values:\n"; for $k (sort map {$hash{$_}[0]} keys %hash) { my $v = $hash{lc $k}[1]; print "$k => $v\n"; } sub showkeys { print "'Keys' in mixed case: " . (join ' ', map {$hash{$_}[0]} keys %hash) . "\n"; }