Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Sorting records on a single field

by jwkrahn (Abbot)
on Jan 20, 2010 at 17:21 UTC ( [id://818511]=note: print w/replies, xml ) Need Help??


in reply to Sorting records on a single field

print for map $_->[1], sort { $b->[0] <=> $a->[0] } map [ /\(millisec\):(\d+)/, $_ ], @data;

Replies are listed 'Best First'.
Re^2: Sorting records on a single field
by kikuchiyo (Hermit) on Jan 20, 2010 at 17:39 UTC
    If the number of interest is always at the end of the lines then a simple /(\d+)$/ would do.
    A combination of rindex and substr instead of the regex would probably be even faster.

    See also this reference work for more pointers.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found