Perl Monk, Perl Meditation | |
PerlMonks |
Re: Why didn't this sort?by stephen (Priest) |
on Jul 15, 2002 at 23:19 UTC ( [id://181965]=note: print w/replies, xml ) | Need Help?? |
sort doesn't sort a list in-place. Instead, it returns a new sorted list. So:
would print out a sorted list, but printing the contents of $outputRef would still print out an unsorted list. If you need to save the sorted list for some reason, use an assignment:
stephen Note: Code untested, my Perlboxen are still in pieces...
In Section
Seekers of Perl Wisdom
|
|