#!/usr/bin/perl $count_file = "count.txt"; $ip_file = "ips.txt"; $ip=$ENV{'REMOTE_ADDR'}; $time=localtime( time ); open(COUNT,"$count_file") || die("Perl SNAFU $!"); ($count) = ; close(COUNT); $count =~ s/\n//; open(FILE,$ip_file) || die("Perl SNAFU $!"); @data=; close(FILE); $countem="0"; foreach $lines (@data) { chop($lines); ($ips,$times,)=split('=',$lines); if ($ip =~ /$ips/i) { if (-M /$times/i > 1) { $countem="0"; } else { $countem="1"; } # End IfTimes } else { $countem="1"; } # End IfIps } # End ForEach if ($countem) { $count++; open(COUNT,">$count_file") || die("Perl SNAFU $!"); print COUNT "$count"; close(COUNT); open(WRITE,">>$ip_file") || die("Perl SNAFU $!"); print WRITE "$ip=$time\n"; close(WRITE); } # End IfCount print "Content-type: text/html\n\n"; print "<\!--\n"; print "document.write(\"$count\");\n"; print "//-->";