I think the new code you have above gives 'use of uninitialized value' warnings because the array-length check is not quite right. I think it needs instead:
$i++ until $i >= @$a or $i >= @$b or $o = ( $a->[$i] cmp $b->[$i] );
$i == @$a would be just as good as $i >= @$a; I can't decide which is clearer.
HugoIn reply to Re^3: Sort problem
by hv
in thread Sort problem
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |