#!/usr/local/bin/perl

# count the number of vistors

print "Content-type: text/html\n\n";
print qq|<HEAD><TITLE>Su-Wan Chien's Homepage</TITLE></HEAD>\n|;
print qq|<BODY BGCOLOR=#FFC0C0 VLINK=#00A000>\n|;

$counterFile='/home/B11A/cwou/WEB/suwan/counter.txt';

if (-e $counterFile) {
     open(COUNT,"$counterFile") || die("Can't open $counterFile: $!\n");
}
$totalReads = <COUNT>;
chop $totalReads;
close(COUNT);
 
$totalReads++;
 
open(COUNT,">$counterFile") || die "$0: can\'t open $counterFile: $!\n";
print (COUNT "$totalReads\n");
close(COUNT);

print qq|<H4>You are the <BLINK>$totalReads</BLINK>th visitor.</H4>|;
print qq|</BODY>\n</HTML>|;

