A
asg
i use the code below for a page counter. when it gets to around a 900
count, it resets to 1. any ideas as to why?
my $counterFile = "adcounter/page1";
if (-e $counterFile) {
open(COUNT,"$counterFile");
flock (COUNT, 2);
my $ergsege= <COUNT>;
close(COUNT);
$ergsege++;
open(COUNT,">$counterFile");
print (COUNT "$ergsege");
close(COUNT);
flock (COUNT, 8);
}
else{
my $ergsege= "1";
open(COUNT,">$counterFile");
flock (COUNT, 2);
print COUNT "1";
close(COUNT);
flock (COUNT, 8);
}
count, it resets to 1. any ideas as to why?
my $counterFile = "adcounter/page1";
if (-e $counterFile) {
open(COUNT,"$counterFile");
flock (COUNT, 2);
my $ergsege= <COUNT>;
close(COUNT);
$ergsege++;
open(COUNT,">$counterFile");
print (COUNT "$ergsege");
close(COUNT);
flock (COUNT, 8);
}
else{
my $ergsege= "1";
open(COUNT,">$counterFile");
flock (COUNT, 2);
print COUNT "1";
close(COUNT);
flock (COUNT, 8);
}