NAME

Script::Singleton - Ensure only a single instance of a script can run

Coverage Status

SYNOPSIS

use Script::Singleton 'LOCK';

DESCRIPTION

Using shared memory, this distribution ensures only a single instance of any script can be running at any one time.

There are no functions or methods. All the work is performed in the use line. LOCK is the glue that identifies the shared memory segment. If a second parameter with a true value is sent in, we'll output a warning if the same script is run at the same time and it exits:

use Script::Singleton 'LOCK', 1;

AUTHOR

Steve Bertrand, <steveb at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2021 Steve Bertrand.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0