Hi !
I wrote my own counter script - I know it's simple and maybe it likes "Sit" - I need help from an advance programmer who can tell me why the flat file (which hold the number inside) got number 6200 yesterday and sudden today it went down to 1500 ?
Here is my script :)
open (FILE, "<$count_log");
flock (FILE,2);
$count = <FILE>;
flock (FILE,8);
close (FILE);
open (FILE, ">$count_log");
flock (FILE,2);
$count2 = $count + 1 ;
print FILE $count2;
flock (FILE,8);
close (FILE);What is the important thing do I need to concern to create the good counter (I mean Do not get damage the flat file)
Thanks for the help
N.A
I wrote my own counter script - I know it's simple and maybe it likes "Sit" - I need help from an advance programmer who can tell me why the flat file (which hold the number inside) got number 6200 yesterday and sudden today it went down to 1500 ?
Here is my script :)
Code:
open (FILE, "<$count_log");
flock (FILE,2);
$count = <FILE>;
flock (FILE,8);
close (FILE);
open (FILE, ">$count_log");
flock (FILE,2);
$count2 = $count + 1 ;
print FILE $count2;
flock (FILE,8);
close (FILE);
Thanks for the help
N.A