|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re: sort directionby radiantmatrix (Parson) |
| on Oct 07, 2005 at 12:17 UTC ( [id://498252]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Accoring to the documentation for sort, it expects a function that returns -1, 0, or 1 for (a<b),(a==b),(a>b), respectively. So, that's all your sub needs to do.
Untested, of course, but the idea should be basically sound. If I understand what you're trying to accomplish, though, you might take a different approach.
<-radiant.matrix->
A collection of thoughts and links from the minds of geeks The Code that can be seen is not the true Code "In any sufficiently large group of people, most are idiots" - Kaa's Law
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||