Help for this page
my %uniq; for ( keys %hash ) { ... $uniq{$reordered_key} += $hash{$_}; } # still untested