in reply to Why didn't this sort?
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.foreach (sort @$outputRef) { print $_, "\n"; }
If you need to save the sorted list for some reason, use an assignment:
@sorted = sort @$outputRef;
stephen
Note: Code untested, my Perlboxen are still in pieces...
|
---|
In Section
Seekers of Perl Wisdom