You have just demonstrated why haukex advised you to "post a question effectively". Your problem now has more to do with reading a file than it does with sorting. You must create a filehandle by opening (open) the file and then read from the filehandle with the diamond operatior <> (perlop). All the answers you have received use the special filehandle DATA which is open by default.
For additional info on sorting, refer to FAQ How do I sort an array by (anything)?
In reply to Re^3: Sort alphabetically from file
by BillKSmith
in thread Sort alphabetically from file
by edujs7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |