in reply to Sorting Puzzle

Just a quick guess - but your numbers are probably too long for perl to do numerical comparisons with.

I thought bigint might help - but you'd have to remove the quotes to get that to work. Otherwise, just change the <=> to cmp to do string comparisons.