in reply to Re^2: sort an array with +ve & -ve numbers in it
in thread sort an array with +ve & -ve numbers in it
As already stated by ikegami, you really need to use the numerical sort: sort {$a <=> $b} @array
Try changing your data set to my @array = ( -10, 99, 67, 0, -100, -38, 98) and using that sort routine. This is probably the problem the OP is having. You're going to get -10 as the minimum.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: sort an array with +ve & -ve numbers in it
by eric256 (Parson) on Apr 03, 2009 at 15:58 UTC | |
by plobsing (Friar) on Apr 05, 2009 at 14:28 UTC |