electronicMacks has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks,
foreach $day (sort (keys (%totals))) {
But with an appropriate argument given to sort.
I could certainly write my own subroutine to sort it, but I feel like I’d be reinventing the wheel, does anyone know of an existing, elegant way to sort mm/dd/yy dates???
I’m writing a program that parses a log containing dates in the format mm/dd/yy, I store these dates in a hash with their respective data, and at the end of the program I’d like to report the dates in order.
I’m thinking something along the lines of:foreach $day (sort (keys (%totals))) {
But with an appropriate argument given to sort.
I could certainly write my own subroutine to sort it, but I feel like I’d be reinventing the wheel, does anyone know of an existing, elegant way to sort mm/dd/yy dates???
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: sorting mm/dd/yy
by tye (Sage) on Dec 15, 2000 at 04:17 UTC | |
by 2501 (Pilgrim) on Dec 15, 2000 at 10:13 UTC | |
by mirod (Canon) on Dec 15, 2000 at 17:35 UTC | |
(Date::Manip) Re: sorting mm/dd/yy
by mwp (Hermit) on Dec 15, 2000 at 04:10 UTC | |
by merlyn (Sage) on Dec 15, 2000 at 04:13 UTC | |
Re: sorting mm/dd/yy
by Hrunting (Pilgrim) on Dec 15, 2000 at 08:02 UTC | |
Re: sorting mm/dd/yy
by Hot Pastrami (Monk) on Dec 15, 2000 at 04:26 UTC | |
Re: sorting mm/dd/yy
by I0 (Priest) on Dec 15, 2000 at 11:11 UTC | |
Re: sorting mm/dd/yy
by royalanjr (Chaplain) on Dec 15, 2000 at 20:23 UTC | |
by merlyn (Sage) on Dec 15, 2000 at 20:30 UTC | |
by royalanjr (Chaplain) on Dec 15, 2000 at 20:41 UTC | |
by Hrunting (Pilgrim) on Dec 15, 2000 at 21:46 UTC | |
Re: sorting mm/dd/yy
by Anonymous Monk on Dec 15, 2000 at 19:42 UTC | |
by neophyte (Curate) on Dec 15, 2000 at 19:51 UTC | |
by davorg (Chancellor) on Dec 15, 2000 at 19:51 UTC | |
Re: sorting mm/dd/yy
by InfiniteSilence (Curate) on Dec 15, 2000 at 21:40 UTC | |
by merlyn (Sage) on Dec 15, 2000 at 21:43 UTC | |
by chipmunk (Parson) on Dec 15, 2000 at 22:01 UTC |
Back to
Seekers of Perl Wisdom