App::Locker - lock/unlock you perl script
use App::Locker;
my $locker=App::Locker->create;
my $pid=fork();
if (!$pid){
# child sleep(1); $locker->unlock; sleep(1);
} else { # parent
print "LOCK\n"; $locker->lock(); print "UNLOCK\n"; }
This module provides create lock point in any place scipt and unlock it from another script place (main, fork, thread).
create main object thith lock api
destroy main object
lock execute script
$locker->unlock($data) # unlock thith transfer any data ($data - must by reference)
Bulichev Evgeniy, bes@cpan.org>.
Copyright (c) 2017 Bulichev Evgeniy. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install App::Locker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Locker
CPAN shell
perl -MCPAN -e shell install App::Locker
For more information on module installation, please visit the detailed CPAN module installation guide.