True, but then there are no guarentees that sort will produce consistant result if you do weird things with overload:
perl> use overload '""' => sub{ rand }, fallback => 1;; perl> @n = map{ bless \$_ } 1 .. 10;; perl> print $$_ for sort{ $a <=> $b } @n;; 10 9 8 4 5 3 7 6 2 1 perl> print $$_ for sort{ $b <=> $a } @n;; 10 5 4 6 3 9 7 8 1 2
In reply to Re^4: sort direction
by BrowserUk
in thread sort direction
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |