Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Simon Davey

by physgreg (Scribe)
on Aug 19, 2002 at 09:44 UTC ( #191122=note: print w/replies, xml ) Need Help??


in reply to Looking for numeric sort (was Simon Davey)

The internal perl sort command can be used to sort numerically:
@sorted_list = sort {$a<=>$b} @unsorted_list
The <=> operator returns 0 if the two numbers are equal, -1 if $a<$b and 1 if $a>$b. Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2023-12-09 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?