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.