This is sort of modeled after Akka's Leader board when I saw his.
Uses HTML to make sure everything lines up correctly.
if ($text=~/Top 10 by HP/i)
{
@table = "<table><TR><TD>#<TD>$Yel NAME </c><TD>$grn HP </c><TD>$Blu MANA </c><TD>$Pink CLASS </c><TD>$Red LEVEL </c><TD>AC<TD>$purp AA </c><TD>";
$sth = $dbh->prepare("SELECT name, hp, mana, class, level, armor, aa FROM leaderboard ORDER BY hp DESC LIMIT 10");
$sth->execute();
$n = 1;
while (my ($pname, $php, $pmana, $pclass, $plevel, $pac, $paa) = $sth->fetchrow_array())
{
my $php2 = plugin::commify($php);
my $pmana2 = plugin::commify($pmana);
my $pac2 = plugin::commify($pac);
my $paa2 = plugin::commify($paa);
push(@table, "<TR><TD>$n<TD>$Yel $pname </c><TD>$grn $php2 </c><TD>$Blu $pmana2 </c><TD>$Pink $pclass </c><TD>$Red $plevel </c><TD>$pac2<TD>$purp $paa2 </c><TD>");
$n++;
}
push(@table, "</table>");
quest::popup("Top 10 by HP", "@table");
$sth->finish ();
$dbh->disconnect();
}
Thats just a part of it obviously but a good idea of how I did it, since I know you would write it with other categories and such.