in reply to Re: Scheduling Perl Tasks
in thread Scheduling Perl Tasks

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.