I aint very good at perl right now, I am learning, please can u tell me what is wrong with the opening of
/hits/[all the id files].txt
and getting there contents which are numbers and ranking them in order highest first, here is the code... thx!
#!/usr/bin/perl print "Content-type:text/html\n\n"; open(USERS,"members.txt"); while(<USERS>){ chomp; my($user,$email) = split(/\|/); open(USR,"$user.txt") or next; $USR = <USR>; close(USR); ($username,$sitename,$url,$email,$button,$desc,$hits) = split(/\|/, + $USR); $rank{$username} = { 'url' => $url, 'email' => $email, 'button' => $button, 'desc' => $desc, 'hits' => $hits, 'sitename' => $sitename, 'user' => $username, }; } print <<EOF; <font face="verdana" color="black"> <table COLS=5 WIDTH=\"75%\" border=\"1\" bordercolor=\"black\" cellSpa +cing=\"0\" cellPadding=\"0\" align=\"center\"> <tr bgcolor="#000080"> <td><b><font face=\"verdana\" color=\"white\"><center>Site</center></f +ont></b></td> <td><b><font face=\"verdana\" color=\"white\"><center>button</center>< +/font></b></td> <td><b><font face=\"verdana\" color=\"white\"><center> Hits </center>< +/font></b></td> </tr> EOF for(sort {$rank{$b}{hits} <=> $rank{$a}{hits}} keys %rank){ print "<tr><td><a href=\"".$rank{$_}{url}."\"><center><b>". $rank{$_}{sitename}."</b></a><br><font face=\"verdana\" size=\"1\"> +<b>$rank{$_}{desc}</b></font><td width=\"88\"><img height=\"31\" widt +h=\"88\" src=\"".$rank{$_}{button}. "\" width=\"88\" height\"31\"></td><td><center>".$rank{$_}{hits}."< +/center></td></tr>\n"; }
Thanks you!!!!

In reply to erm... I need help! by perlcoder

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.