Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: best way to keep a simple count?

by salva (Canon)
on Apr 11, 2005 at 14:47 UTC ( [id://446631]=note: print w/replies, xml ) Need Help??


in reply to best way to keep a simple count?

use a Config::* module that allows writting:
#!/usr/bin/perl use warnings; use strict; use Config::Properties::Simple; my $cfg=Config::Properties::Simple->new(scope=>'user', optional=>1); my $count=$cfg->getProperty(counter => 0); print "counter: $count\n"; $cfg->setProperty(counter => ++$count); $cfg->save;

You should also use some lock to ensure that only one process reads and increments the counter.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found