I looked at those posts and they only further confused me as to how to sort my sites according to their traffic in. I only want the script to sort them by their traffic in, I don't care about alphabetical order or anything. I just need to know how to make the script read my database file like this:

Sitename|SiteURL|Hitsout|HitsIn

and then display the sites in order of hits, and numbering them. If you could show me how to do this I would really appreciate it.

In the first three lines, you open a file, read all the lines into an array, and close the file. Then you try to read from the file as input to the map. But DATA has been closed, and even if you did not have the close line, you have already read all the lines out of it and <DATA> is empty.

OK, everything works and it ranks the database, but it ranks the items from lowest to highest instead of highest to lowest. Like it puts the sites with the most traffic lower and the sites with less traffic higher. How do I make it rank them visa versa. The script now looks like this: