Jul 31, 2000, 8:27 AM
Post #10 of 11
I think my sort is doing what I want and putting things in order.
I tested with...
my @array = ('103', 82, "104.6", 0.23, '101.2', '.762', 105, '102', "1.", 6, "2", "3.01", "3");
and got the order I expected.
But even if it is not quite right, the only part that needs to change is the lower map (between the input array and the sort). By using a long string from sprintf we can make sure that any input number will fit into one string, and don't need multiple fields for the sort.
As to where I learned about such things, I was at last year's The Perl Conference 3.0 when they first presented the paper and won $1000 for best paper. Howerver, I did not know until Kanji pointed it out, that we now have a new name for these things. I thought they were still just Schwartzian Transforms.
If you read the actual paper from the link at the bottom of the Perlfaq link to http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html you will find benchmarks in Appendix A. They seem to get twice the speed using the built in sort over more complicated sorts for arrays longer than 1000 lines.