Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Use of uninitialized value in string comparison (cmp)

by Discipulus (Canon)
on Sep 16, 2015 at 10:49 UTC ( [id://1142185]=note: print w/replies, xml ) Need Help??


in reply to Use of uninitialized value in string comparison (cmp)

Hello,

sort needs to operate on $a and $b not on $_
#sorry win quote perl -wle "@r=({k=>'r'},{k=>'s'},{k=>'t'});print $_->{k} for sort { $a +->{k} cmp $b->{k} } @r;" r s t

L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Use of uninitialized value in string comparison (cmp)
by Random_Walk (Prior) on Sep 16, 2015 at 10:57 UTC

    Aaarrgghhh, I knew I had been staring at it too long. I knew that, but it slipped out my memcache somewhere :(. Thanks for the reminder.

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1142185]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-16 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found