#!/usr/bin/perl
# This script shows the 5 most popular games, very linux centric, could work in cgywin, dunno
$cwd = $0;
$cwd =~ s/top5\.pl//ig;
chop($cwd); # remove / from end
@log = `sort $cwd/favmame.log |uniq -c |sort -rn |head -5`;
print "Content-type: text/html\n\n";
foreach $line (@log) {
$i++;
($count, $game, $rom) = split(/\"/, $line, 3);
$game =~ s/\"//ig;
$rom =~ s/ //ig;
chomp($rom);
print "$game
\n";
}