use strict; use warnings; use utf8::all; my %hash = ( the => 5, good => 3, The => 2, Bad => 2, uGly => 1, uglY => 1, École => 1, ); for my $key (keys %hash) { next unless $key =~ /^\p{Uppercase_letter}/; my $lckey = lc $key; $hash{$lckey} += delete $hash{$key} if exists $hash{$lckey}; } for my $key (sort {$hash{$b} <=> $hash{$a}} keys %hash) { print "$key\t$hash{$key}\n"; }