#!/usr/bin/perl

#change first line to proper perl location.

###########################################
#Very simple PERL text based counter.
#upload this script to your cgi-bin directory and chmod to 755.
#to use it simple add this code to your html.
#<script language="javascript" src="http://yourdomain.com/cgi-bin/counter.cgi"></script>
#If you have problems you can contact webmaster@dony.com.kg
#This script is free of charge. Do not hesitate to suggest this script to your friends.
#Thanks for using this script.
#www.dony.com.kg
###########################################

$log="counter.txt";	#counter file.

#nothing else to change leave it as is.

open (FILE,$log);
$counter=<FILE>;
close(FILE);
$counter++;
open (WRITE,">$log");
print WRITE "$counter";
close(WRITE);
print "Content-type: text/html\n\n";
print "document.write($counter)";