Your hash doesn't have any three letter keys, and your substr doesn't return three letters. Perhaps you meant:
my @key_hash = sort { substr($a,0,3) cmp substr($b,0,3) } keys %key_hash;
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Sorting a hash of hashes
by jasonk
in thread Sorting a hash of hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |