Well, $a and $b are globals... so just put your conditionals into a sub and then omit your parens in the sort-call and it'll work pretty much just like you have it. There are examples of that on the sort page. You'll be amused to see how close you really were.
-Paul
In reply to Re: Refactor my sort
by jettero
in thread Refactor my sort
by Herkum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |