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???
Back to
Seekers of Perl Wisdom