laziness, impatience, and hubris | |
PerlMonks |
Re: sort mechanismby satchboost (Scribe) |
on Apr 06, 2001 at 20:16 UTC ( [id://70505]=note: print w/replies, xml ) | Need Help?? |
This brings up an interesting question. Reading the Library notes on sort seem to indicate that it will return a list (of sorted values). So, the following code does what you'd think it does: print (3, 2, 1) ? "yes" : "no"; However, if you change it to: print sort (3, 2, 1) ? "yes" : "no"; you get "no", not "yes". Why does this behavior happen? I'm obviously not understanding something about the sort function.
In Section
Seekers of Perl Wisdom
|
|