\n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE " Address | \n";
print OUTFILE " Location | \n";
print OUTFILE " Description | \n";
print OUTFILE " URL | \n";
print OUTFILE " Uptime | \n";
print OUTFILE " Contact | \n";
print OUTFILE " Software | \n";
print OUTFILE " U | \n";
print OUTFILE " C | \n";
print OUTFILE " G | \n";
print OUTFILE " \n";
$allservers = 0;
$allusers = 0;
$allgames = 0;
foreach $server (@servers) {
print OUTFILE " \n";
$/ = "\#\#\n";
# Fix-up for special characters
$server =~ s/&/&/g;
$server =~ s/</g;
$server =~ s/>/>/g;
@serverinfo = split /^\#\#\n/m, $server;
chomp @serverinfo;
chop @serverinfo;
# put fields into descriptive variable names
$addr = $serverinfo[0];
$loc = $serverinfo[2];
if (length($loc)<1) {
$loc = " ";
}
$desc = $serverinfo[8];
if (length($desc)<1) {
$desc = " ";
}
$soft = $serverinfo[3] . " " . $serverinfo[4];
$osys = $serverinfo[9];
if (length($osys)<1) {
$osys = "unknown";
}
$url = $serverinfo[10];
$contact = $serverinfo[11];
if (length($contact)<1) {
$contact = " ";
}
$email = $serverinfo[12];
$currusers = $serverinfo[5];
$totusers = $serverinfo[15];
$currchans = $serverinfo[6];
$currgames = $serverinfo[7];
$totgames = $serverinfo[14];
$uptime = sprintf("%02d:%02d:%02d",int $serverinfo[13]/3600, int ($serverinfo[13]%3600)/60, int $serverinfo[13]%60);
# print it out
print OUTFILE " $addr | \n"; # IP
print OUTFILE " $loc | \n";
print OUTFILE " $desc | \n";
if (length($url)<1) {
print OUTFILE " | \n";
} else {
print OUTFILE " $url | \n";
}
print OUTFILE " $uptime | \n";
if (length($email)<1) {
print OUTFILE " $contact | \n";
} else {
print OUTFILE " $contact ($email) | \n";
}
print OUTFILE " $soft $osys | \n";
print OUTFILE " ${currusers}c ${totusers}t | \n";
print OUTFILE " ${currchans} | \n";
print OUTFILE " ${currgames}c ${totgames}t | \n";
print OUTFILE " \n";
$allservers++;
$allusers+=${currusers};
$allgames+=${currgames};
}
print OUTFILE " \n";
print OUTFILE " | \n";
print OUTFILE " \n";
print OUTFILE " \n";
print OUTFILE "
\n";
print OUTFILE " | \n";
print OUTFILE "
\n";
print OUTFILE "