
jazzo
Novice
Aug 26, 2012, 3:07 PM
Post #4 of 7
(726 views)
|
|
Re: [Laurent_R] sorting numbers and string
[In reply to]
|
Can't Post
|
|
thanks guys. Needless to say, I am very happy to read the documentation, but I have no idea where to find, could you kindly let me know how to get to it? Sorry I am really really new to perl. Also, to get back to the script: what it does in in theory clear, and it is better now that you added more info to it, but practically, I don't understand how many times this line my @number = sort { $a <=> $b } @unsorted; runs. It must compare 2 numbers at each pass, so I assume it runs 4 times comparing respectively the 1st and 2nd, the 3rd and 4th, 5th and 6th, 7th and 8th number, or not? so comparison between 1 and 2 returns -1 because as you have said a belongs before b , then 11 and 24 returns -1 again and then what happens? 3 is smaller than 11 so does it get compared against it? thanks
|