Greetings.
The project is completed including a release on CPAN. To ensure a given script is executing once, the following is how to do it using Mutex. That will block until obtaining an exclusive lock. A false value is returned if the timeout is reached, and a true value otherwise.
use Mutex; my $mutex = Mutex->new( path => $0 ); # terminate script if a previous instance is still running exit unless $mutex->timedwait( 2 ); ...
Regards, Mario
Edit: Updated the CPAN link to point to the 1.001 release.
In reply to Re^2: Scheduling Perl Tasks
by marioroy
in thread Scheduling Perl Tasks
by 9mohit2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |