That makes things far more complicated. Because _compare is likely to be in a package other than the sort, _compare would have to use ${ caller.'::a' } and ${ caller.'::b' } instead of $_[0] and $_[1]. Best to pass $a and $b are arguments.
In reply to Re^3: Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by ikegami
in thread Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by anonymized user 468275
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |