Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: SSI PERL wisdom needed

by larryl (Scribe)
on Mar 11, 2001 at 04:54 UTC ( #63555=note: print w/ replies, xml ) Need Help??


in reply to SSI PERL wisdom needed

You might want to take a look at File::CounterFile by Gisle Aas which keeps file-based counters like yours. It uses file locking to handle multiple processes trying to modify the file at the same time, which will be an issue for you because you could have multiple simultaneous HTTP requests going on.

It's very easy to use. This will open the file, increment the value, and return you the updated value:

use File::CounterFile; $c = new File::CounterFile $data_file, $initial_value; $raw_data = $c->inc;


Comment on Re: SSI PERL wisdom needed
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-09-02 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls