anmaco has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl # A visit counter ###################################### # Definition of variables # fichierhtml is the file in which the visits are counted # fichiernombre saves the visits ########################################### $ fichiernombre = "/cgi-bin/compteleshits"; ########################################### #First stage : open the file containing the hits to read open(hits,"$fichiernombre"); # Second stage : read the visits and save them in a # new variable $visites=(hits); #Third stage : close the file containing the hits close $fichiernombre #Fourth stage : open the file containing the hits for writing open(hits,">$fichiernombre "); #Fifth stage : increase by 1 the variables which contain #the visits made and rewrite them in fichiernombre print hits ++ $visites; #Sixth stage : close the file containing the visits close %
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hit Counter
by turnstep (Parson) on May 21, 2000 at 22:16 UTC | |
|
Re: Hit Counter
by btrott (Parson) on May 21, 2000 at 21:55 UTC | |
by anmaco (Novice) on May 21, 2000 at 23:07 UTC | |
|
Re: Hit Counter
by Punto (Scribe) on May 22, 2000 at 05:25 UTC | |
|
Re: Hit Counter
by KM (Priest) on May 22, 2000 at 07:25 UTC |