Help for this page
@list= sort { @$a <=> @$b || ... secondary criterion ... || ... tertiary criterion ... } @list;
$a->[-1] cmp $b->[-1] # untested
@list= sort { @$a <=> @$b || $a->[-1] cmp $b->[-1] } @list;