No it isn't. Pearl uses the the ASCII comparison as the standard sort method in its function sort().
the sub build_sort_links uses this line of code to merge and sort the two arrays:
my @c = sort { lc join ("", @{$a}[@fields]) cmp lc join ("", @{$b}[@fields]) } @{$arr_b}, @{$arr_a};
where the sort criteria is in the array @fields (Rating, Hits, Votes)
To force the sort routine to sort numeric it has to be called this way:
@sorted= sort {$a <=> $b} @unsorted;
Is there anybody out there who can translate the first line of code and modify it to the numeric sort?
regards, alexander
the sub build_sort_links uses this line of code to merge and sort the two arrays:
my @c = sort { lc join ("", @{$a}[@fields]) cmp lc join ("", @{$b}[@fields]) } @{$arr_b}, @{$arr_a};
where the sort criteria is in the array @fields (Rating, Hits, Votes)
To force the sort routine to sort numeric it has to be called this way:
@sorted= sort {$a <=> $b} @unsorted;
Is there anybody out there who can translate the first line of code and modify it to the numeric sort?
regards, alexander