in reply to Sort hash by key length and alphabetically

length($a) <=> length($b) || $a cmp $b
Perl 6 - links to (nearly) everything that is Perl 6.