Welcome to the Monastery | |
PerlMonks |
Re: sorting a fileby mp (Deacon) |
on Sep 10, 2002 at 19:02 UTC ( [id://196787]=note: print w/replies, xml ) | Need Help?? |
Assuming the list of names is small enough to fit in memory, this should work:
Note that I moved the sort outside of the loop. The list of names cannot be sorted until the list has been built. The first loop builds the list of names, and the second list prints it in sorted order.
In Section
Seekers of Perl Wisdom
|
|