Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Quick and dirty counter

by merlyn (Sage)
on Jan 18, 2002 at 21:38 UTC ( [id://139877]=note: print w/replies, xml ) Need Help??


in reply to Quick and dirty counter

This is quick, dirty, and faulty. You are not getting exclusive access to the file, so if multiple hits come in at roughly the same time, someone will zero the file while someone else is reading it, and your counter will "reset". It's not a matter of "if", but "when".

What problems did you have with File::CounterFile? That would be more instructive to bring out than to rewrite it (and incorrectly!).

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Quick and dirty counter
by cecil36 (Pilgrim) on Jan 18, 2002 at 23:34 UTC
    The purpose of the counter is not for use with a web page. I created it for personal use with a script that I found and modified that tracks packages shipped via UPS. The output is an ASCII file that is sent to a pager program to send to a pager. The counter is used to put a file extension on the text file output prior to writing the output to the file.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://139877]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-20 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found