Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: sorting a two dimensional array by one column

by bigj (Monk)
on Jul 14, 2003 at 15:32 UTC ( [id://274005]=note: print w/replies, xml ) Need Help??


in reply to sorting a two dimensional array by one column

In addition to the others, there is a shorter way to sort for the first column of a two dimensional array:

my @sorted = sort {"@$a" <=> "@$b"} @two_dim;

But please don't use it in production code :-)

Greetings,
Janek
  • Comment on Re: sorting a two dimensional array by one column

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found