In an here document you don't need to escape quotes.
Inside your here document you missed the closing tag for the table.
If you want to print a string that contains double quotes you might use single quotes for that string eg:
print '<tr><td><a href="'.$rank{$_}{url}.'"><center><b>';
please correct your line as you omitted the ' for the hits:
for (sort {$rank{$b}{'hits'} <=> $rank{$a}{'hits'}} keys %rank)
Have a nice day
All decision is left to your taste
Update
as far as I came with it. Better try to use cgi.pm. It is easy and helps you a lot.
#!/usr/bin/perl -w
use strict;
my $memberListFile = "members.txt";
my $hits;
my %rank;
my $user;
my $email;
my $username;
my $sitename;
my $url;
my $button;
my $desc;
print "Content-type:text/html\n\n";
open(USERS, $memberListFile) die ("can't open $memberListFile: $!");
while(<USERS>)
{
chomp; # ah, cleverly working on $_
($user,$email) = split(/\|/);
my $USR; # better find some naming conventions, for me looks this
+like a CONSTANT in the source
$user .= ".txt"; # still ugly, but better compose filenames before
+ using them (makes debugging easier)
open (USR,"$user") or die ("can't open $user: $!");
$USR = <USR>; # scalar context ? why? do all these files only have
+ one line?
close(USR);
($username, $sitename, $url, $email, $button, $desc, $hits) = spli
+t(/\|/, $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 WIDTH="75%" border="1" bordercolor="black" cellSpacing="0" cell
+Padding="0" align="center">
<tr bgcolor="#000080">
<th>
<font face="verdana" color="white">
Site
</font>
</th>
<th>
<font face="verdana" color="white">
button
</font>
</th>
<th>
<font face="verdana" color="white">
Hits
</font>
</th>
</tr>
eof
foreach (sort {$rank{$b}{'hits'} <=> $rank{$a}{'hits'}} keys %rank)
{
# oh ouh here it is not clever to work with $_
print <<eof;
<tr>
<td align="center">
<b>
<a href="$rank{$_}{url}">
$rank{$_}{sitename}
</a>
<br />
<font face="verdana" size="1">
$rank{$_}{desc}
</font>
</b>
</td>
<td align="center" width="88">
<img src="$rank{$_}{button}" height="31" width="88">
</td>
<td align="center">
$rank{$_}{hits}
</td>
</tr>
eof
}
print "</table>\n</font>";