my $lock = "/tmp/lock_foo"; if( ! -f $lock || time - (stat($lock))[9] > 600 ){ # do stuff open FILE '>', $lock; # optionally write info/details to it }
use Cache::FileCache; my $cache = new Cache::FileCache( { namespace=>"TimeLocks" } ); my $key = "something_bad"; if( ! $cache->get($key) ){ # do stuff $cache->set( $key, time, "10 minutes" ); # note the value could jus +t be '1', or any other true value. }
In reply to Re: RFC: Time Lock Module Idea?
by davidrw
in thread RFC: Time Lock Module Idea?
by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |