Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have an array like the following:
@event_queue = ("$time\tEvent 1", "$time\tEvent 5", "$time\tEvent 3";
My array will grow to probably 100 elements, with the time element increasing at random, and I want to sort the array in ascending order based on the time portion.
@event_queue = sort { $a <=> $b } @event_queue;This is currently what I'm doing
Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sort routine
by Abigail-II (Bishop) on Sep 18, 2002 at 11:45 UTC | |
by Anonymous Monk on Sep 18, 2002 at 11:48 UTC | |
by Abigail-II (Bishop) on Sep 18, 2002 at 11:55 UTC | |
|
Re: Sort routine
by RMGir (Prior) on Sep 18, 2002 at 12:02 UTC | |
|
Re: Sort routine
by dada (Chaplain) on Sep 18, 2002 at 11:56 UTC | |
by Aristotle (Chancellor) on Sep 18, 2002 at 20:09 UTC | |
|
Re: Sort routine
by Anonymous Monk on Sep 18, 2002 at 12:18 UTC |