#!/usr/bin/perl open(IN,"counts"); flock(IN,2); # lock the file seek(IN,0,0); # rewind it to the beginning $count = ; # read only the first line. close(IN); $count = $count + 1; open(OUT,">counts"); flock(OUT,2); # lock the file seek(OUT,0,0); # rewind it to the beginning print OUT "$count\n"; close(OUT); print "Content-type:text/html\n\n"; print "You are visitor number $count.

\n";