Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sort on Number Embedded in String

by TilRMan (Friar)
on Mar 23, 2005 at 05:06 UTC ( #441689=note: print w/replies, xml ) Need Help??


in reply to Sort on Number Embedded in String

I want to sort on the date.

Try Date::Parse.

use Date::Parse qw( str2time ); sub date { my ($file) = @_; $file =~ /fwlog\.(.*)\.gz/ or warn "Unrecognized filename format"; return str2time($1); } my @sorted = sort { date($a) <=> date($b) } @files;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2016-09-28 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (540 votes). Check out past polls.