in reply to Re^2: Sorting HoHoA based on Length of Second Key
in thread Sorting HoHoA based on Length of Second Key

Just change the expression

( keys %{ $HoHoA{ $_ } } )
to
( keys %{ $HoHoA{ $_ } }, '' )
That way the resulting list will always have at least one element (of length 0).

the lowliest monk