#!/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.
In reply to Re: best way to keep a simple count?
by salva
in thread best way to keep a simple count?
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |