http://www.perlmonks.org?node_id=848179


in reply to Sort hash ref of Hash of Hashes

You are comparing string values 'PQRST' etc... but using the numerical sort (spaceship '<=>') operator. You should be using cmp. See sort for more info.

Just a something something...

Replies are listed 'Best First'.
Re^2: Sort hash ref of Hash of Hashes
by moritz (Cardinal) on Jul 06, 2010 at 11:44 UTC
    ... and use warnings; would have warned you that Argument "PQRST" isn't numeric in numeric comparison (<=>) at ....

    So, always use warnings;. (Documented in perllexwarn).