in reply to How do I sort a Hash of Hashes?

You have to rewrite the code so, that it sorts using the string comparitor (cmp) and you have to dereference the Hash of Hashes with an arrow operator.

sort { $products{$a}->{"name"} cmp $products{$b}->{"name"} }

Replies are listed 'Best First'.
Re: Answer: How do I sort a Hash of Hashes?
by ysth (Canon) on Jan 11, 2004 at 07:27 UTC
    You have to rewrite the code so, that it sorts using the string comparitor (cmp) and you have to dereference the Hash of Hashes with an arrow operator.
    The extra arrow isn't needed anymore. This changed sometime at or before 5.6.1.