-
-
28 Nov 2015 18:59:44 UTC
- Distribution: IPC-Lockfile
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (1)
- Testers (442 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: freebsd
- Activity
24 month- Tools
- Download (8.46KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Fcntl
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
IPC::Lockfile - run only one instance of a program at a time using flock
VERSION
version 0.05
SYNOPSIS
Just import the module:
#!/usr/bin/env perl use IPC::Lockfile; ... # program code here
This will open a lock on the program file, avoiding the need for an external lockfile. This elegant solution for lockfiles was proposed by Mark Jason Dominus.
DESCRIPTION
IPC::Lockfile
is a module for use with Perl programs when you only want one instance of the script to run at a time. It usesflock
and should work if run on an OS that supportsflock
(e.g. Linux, BSD, OSX and Windows).SEE ALSO
Sys::RunAlone for a more flexible module that uses the same technique as
IPC::Lockfile
My PerlTricks.com article about this solution.
IPC::Pidfile for a PID-based solution that relies on signals and has a race condition (not recommended).
AUTHOR
David Farrell <dfarrell@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
Module Install Instructions
To install IPC::Lockfile, copy and paste the appropriate command in to your terminal.
cpanm IPC::Lockfile
perl -MCPAN -e shell install IPC::Lockfile
For more information on module installation, please visit the detailed CPAN module installation guide.