Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Sort routineby RMGir (Prior) |
on Sep 18, 2002 at 12:02 UTC ( [id://198802]=note: print w/replies, xml ) | Need Help?? |
You've got a few options. You can change how you store your data, storing your time values with 0 padding, like this:
That's actually a variant of a technique called the Guttman Rossler Transform; in the GRT you'd encode your times just before sorting, and decode them after you're done. But if you can just keep them in sortable form all along, life is simpler. The other alternative is the Schwartzian Transform, which is a fraction less efficient, but will still do the job very well... The trick here is that the time values are extracted, and then compared as integers to get things in the right order. Then the strings that were associated with those integers are returned by the top map call. -- Mike
In Section
Seekers of Perl Wisdom
|
|