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

Re: Sorting multiple arrays

by dorward (Curate)
on Sep 13, 2005 at 15:25 UTC ( [id://491603]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = (
      { name => 'fred',  number => 2 },
    ...
      { name => 'john',  number => 4 },
      { name => 'peter', number => 3 },
    );
    
  2. or download this
    @array = sort { $a->{number} <=> $b->{number} } @array;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found