in reply to Re: How to sort an array of hashes based on one of the values in the hash?
in thread How to sort an array of hashes based on one of the values in the hash?

Yes, but you want cmp not <=>.

cmp is for ASCIIbetical sorting; <=> is for numeric sorting. (And Unicode::Collate is for proper, decent alphabetical sorting.)

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^3: How to sort an array of hashes based on one of the values in the hash?
by blue_cowdawg (Monsignor) on Mar 08, 2013 at 16:34 UTC
        Yes, but you want cmp not <=>.

    Dammit! My fingertips did it again! I thought one thing and typed another!


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg