laziness, impatience, and hubris | |
PerlMonks |
Sorting Timesby mt2k (Hermit) |
on Apr 28, 2001 at 04:46 UTC ( [id://76319]=perlquestion: print w/replies, xml ) | Need Help?? |
mt2k has asked for the wisdom of the Perl Monks concerning the following question:
I have a really hard question that I can't seem to figure out (okay, so I *can't* figure it out!)... How would I go about sorting times, that include the hour, minutes, and AM/PM, into a well-sorted list??
Here is what the times I need to sort would look like:
The way I want these sorted is in the order that the times pass during a day. So, the above examples should sort out to:
So basically, how would I go sorting these? I can't use a simple sort { $a cmp $b}, because then it sorts to:
Thanks in advance!
Back to
Seekers of Perl Wisdom
|
|