The way I would do it would be to use sort to assign to an array for each site. Then take the number of hits from each site, and join it with the name of the site into another array, with the number first. That way you can sort the array and it will be the number of hits each site had in order. You can then recall it by using a scalar value for the Array. If that's not good enough you can use REGEX to match the name from the array with all the stats in the site's own array. Hope this makes sense,
$i = 0; open(DATA,"text.txt"); foreach $line (<DATA>) { @site1 = split " ", $line; $master[$i] = "$site1[0], $site1[1]"; } sort @master; print "1. $master[0]"; print "2. $master[1]"; print "3. $master[2]"; print "4. $master[3]"; print "5. $master[4]";

I know this doesn't quite work because of the name of the array for each site, but you should be able to figure that out for yourself.

- p u n k k i d
"Reality is merely an illusion, albeit a very persistent one."
-Albert Einstein


In reply to Re: Ranking numbers ..... by elusion
in thread Ranking numbers ..... by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.