Dr. Mu has asked for the wisdom of the Perl Monks concerning the following question:

Does sort come with any documented guarantee that the original order of "equal" items will be preserved? If so, can this behavior be counted on to persist from one version of Perl to the next? If not, is there a better way to do so than the following?
@sorted = sort {&foo($orig[$a]) cmp &foo($orig[$b]) || $a <=> $b} (0 . +. @orig - 1)
where &foo returns the field or aspect of each item being sorted on (and where a Schwartzian Transform would be performed if @orig is sufficiently long and &foo is sufficiently complicated).

(The best answer will end up as a margin note in my camel book.)