-
-
20 Aug 2021 12:26:15 UTC
- Distribution: Script-Singleton
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (112 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: artistic_2
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (3.93KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Cwd
- IPC::Shareable
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Script::Singleton - Ensure only a single instance of a script can run
SYNOPSIS
use Script::Singleton; # Yep, that's it!
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.
This software uses IPC::Shareable for the shared memory management, specifically its singleton() method.
EXAMPLES
Basic
use Script::Singleton;
Using it in the default, basic fashion, we'll create an IPC identifier (glue) using the full path and name of the calling script. We also won't output any warnings if a second instance of the script attempts to run before the initial run has completed and released the lock.
Custom glue
use Script::Singleton glue => 'UNIQUE GLUE STRING';
That will use UNIQUE GLUE STRING as the IPC glue. The glue parameter can be used in conjunction with the warn parameter.
Warnings
use Script::Singleton warn => 1;
If the
warn
parameter is sent in with a true value, we'll emit a warning if a second instance of the script is run. The warn parameter can be used in conjunction with the glue parameter.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:
Module Install Instructions
To install Script::Singleton, copy and paste the appropriate command in to your terminal.
cpanm Script::Singleton
perl -MCPAN -e shell install Script::Singleton
For more information on module installation, please visit the detailed CPAN module installation guide.