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.Actually, according to your link:
SUBNAME ... gives the name of a subroutine that returns an integer less than, equal to, or greater than 0which is rather less stringent than requiring -1, 0 or 1.
Roger
In reply to Re^2: sort direction
by Roger_B
in thread sort direction
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |