in reply to Sorting a hash of hashes
If your trying to sort by the first three chars of the key, then you need only to substr the key
my @key_hash = sort { substr($a,3) cmp substr($b,3) } keys %key_hash;
If your trying to sort by the first 3 chars of the value, you need to apply the substr to the value
my @key_hash = sort { substr($key_hash{$a},3) cmp substr($key_hash{$b},3) } keys %key_hash;
|
|---|