#!c:/perl
open (COUNT, "count.txt") or die "Cannot open $count for read :$!";
for $line (<COUNT>) {
chomp $line;
push (@digits, $line);
}
close COUNT;
$a = $digits[6];
$b = $digits[5];
$c = $digits[4];
$d = $digits[3];
$e = $digits[2];
$f = $digits[1];
$g = $digits[0];
$a++;
if ($a == 10) {
	$a = 0;
	$b++;
	if ($b == 10) {
		$b = 0;
		$c++;
		if ($b == 10) {
			$c = 0;
			$d++;
			if ($b == 10) {
				$d = 0;
				$e++;
				if ($b == 10) {
					$e = 0;
					$f++;
					if ($b == 10) {
						$f = 0;
						$g++;
					}
				}
			}
		}
	}
}

print "<html><head><title>Counter v.1.0</title></head><body><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr width=\"140\"><td height=\"30\" width=\"20\"><img src=\"$g.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$f.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$e.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$d.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$c.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$b.gif\"></td><td height=\"30\" width=\"20\"><img src=\"$a.gif\"></td></tr></table></body></html>";
open (RECOUNT, ">count.txt") or die "can't overwrite!!";
print RECOUNT "$g\n$f\n$e\n$d\n$c\n$b\n$a";
close RECOUNT;


