Subject: | B::CC cannot sort |
This moved from [PERL #2900] here.
The simple pp_sort bug for B::CC was fixed
in B-C-1.04_27, B::CC 1.02_03. It never worked.
* CC.pm (1.02_03): fixed endless loop in optimized sort. The sortcv
cmp needed a return NULL (test 19).
More pp_sort bugs are handled in tests 18 and 25
and I'm working on it.
# 25 - simple sort
print sort { print $i++," "; $b <=> $a } 1..4
=> 0 1 2 3 4321
# 18 - custom key sort 18
my $h = { a=>3, b=>1 }; print sort {$h->{$a} <=> $h->{$b}} keys %$h
=> ba
# 19 - fool the sort optimizer by my $p. This pp_sort works ok now on CC
print sort { my $p; $b <=> $a } 1,4,3
=> 431
--
Reini Urban