in reply to Is sorting different in Perl 5.6.1 than in Perl 5.8.8?

Beware that the sort pragma isn't lexically scoped. If you're in an environment where you can't rely on sort.pm you could use a transform to handle stability, assuming your memory can handle that.

my @sorted = map $_->[0], sort { $a->[0]->{val} <=> $b->[0]->{val} or $a->[1] <=> $b->[1] } map [ $assorted[$_] => $_ ], 0 .. $#assorted ;

lodin