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

Re: How to sort output?

by quester (Vicar)
on Jul 22, 2007 at 07:00 UTC ( #628089=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sorted=
      map { $_->[0] }
      sort { $a->[1] cmp $b->[1] }
      map { [$_, ( / (\d*\.\d*) ms/ and $1 or 0 ) ] }
      @data;
    
  2. or download this
    / (\d*\.\d*) ms/ and $1 or 0
    
  3. or download this
    my @sorted=
      map { $_->[0] }
      sort { $a->[1] <=> $b->[1] }
      map { [$_, ( / (\d*\.\d*) ms/ and $1 or 0 ) ] }
      @data;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://628089]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2016-12-06 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (100 votes). Check out past polls.