in reply to Re^2: sort based on date
in thread sort based on date
grep? What are you trying to filter out?
Anyway, the following manipulations are twice as fast:
my %month_key_lookup = ( 'Jan' => 'a', 'Feb' => 'b', ... 'Dec' => 'l', ); my @sorted_dates = map substr($_, 12), sort map { /^(.{3}) (\d?)(. .*)/s; $month_key_lookup{$1}.($2||'0').$3.$_ } @dates;
As a bonus, it doesn't clobber the contents of @dates.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: sort based on date
by Anonymous Monk on Aug 09, 2010 at 11:15 UTC |