Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: sorting a list of hashes on an element/attribute of the hash

by w-ber (Hermit)
on Jun 04, 2007 at 13:59 UTC ( #619127=note: print w/ replies, xml ) Need Help??


in reply to sorting a list of hashes on an element/attribute of the hash

There are a few ways, but here's one:

@$data = sort { $a->{order} <=> $b->{order} } @$data;

--
print "Just Another Perl Adept\n";


Comment on Re: sorting a list of hashes on an element/attribute of the hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-30 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls