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

These solutions assume that all the secondary hashes contain at least one key.
It's me again sir,

Sorry to disturb you.
how can I modify your snippet if there happen to be a 'primary' key that has no value, for example there is additional:
'set5' =>{},
Just like in my recent posting.
I can always turn off warning, but it is still troubling. Hope to hear from you again.


---
neversaint and everlastingly indebted.......

Replies are listed 'Best First'.
Re^3: Sorting HoHoA based on Length of Second Key
by tlm (Prior) on Jul 27, 2005 at 06:37 UTC

    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