in reply to Re^2: double sort HoH by value/key
in thread double sort HoH by value/key

I think my trouble is in understanding what $a and $b are referring to.

They are referring to the elements you pass into the sort routine. Which element of that list gets associated when to $a or to $b is sort's business. doc;//sort assigns elements of that list to $a and $b as aliases, as the underlying sort algorithm demands.

You were passing keys %HoH to the sort function, hence the keys of the outer hash, the chars (a .. g) in the order perl's hashing implementation sees fit. $a and $b, inside the sort function block, will never be anything else than an alias to an element of the list you passed in.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}