Keep It Simple, Stupid | |
PerlMonks |
Negative number sorting?by Ineffectual (Scribe) |
on Dec 29, 2001 at 01:17 UTC ( [id://134985]=perlquestion: print w/replies, xml ) | Need Help?? |
Ineffectual has asked for the wisdom of the Perl Monks concerning the following question:
Hey monks,
I have an array that has negative numbers in it which I would like to sort ascending, but neither normal sort nor <=> sort seem to have an effect on the array positioning. I'm assuming this is because of the negative numbers involved. Anyone have a different <=> that would be able to sort negative numbers? my @array = [ -15, 991, -9, 980, 1, 911, 281, 1299, 870, 1205, 1, 1 ] Thanks! Ineffectual
Back to
Seekers of Perl Wisdom
|
|