Skip Menu |

This queue is for tickets about the Sys-RunAlone-User CPAN distribution.

Report information
The Basics
Id: 82383
Status: open
Priority: 0/
Queue: Sys-RunAlone-User

People
Owner: pedlar [...] cpan.org
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.01
Fixed in: (no value)



Subject: Feature Request pass in user
It would be nice if I could pass in the "userName" token. my($userName) = delete($args{userName}) ||(getpwuid($>))[0]; I think you could use it like this. BEGIN { my $token=shift || "default"; } use Sys::RunAlone::User userName => $token; I think that would work unless there is some kind of chicken and egg thing going on behind the scenes where `use` normally happens at compile time. Thanks, Mike mrdvt92
On Thu Jan 03 13:47:10 2013, MRDVT wrote: Show quoted text
> It would be nice if I could pass in the "userName" token. > > my($userName) = delete($args{userName}) ||(getpwuid($>))[0]; > > I think you could use it like this. > > BEGIN { > my $token=shift || "default"; > } > use Sys::RunAlone::User userName => $token; > > I think that would work unless there is some kind of chicken and egg > thing going on behind the scenes where `use` normally happens at > compile time. > > Thanks, > Mike > > mrdvt92
Sorry I've been away for some time. I will work on adding this feature for you soon.
Show quoted text
> On Thu Jan 03 13:47:10 2013, MRDVT wrote: > It would be nice if I could pass in the "userName" token.
I am able to do this capability with Lazy::Lockfile. Thanks, Mike #!/usr/bin/perl use strict; use warnings; use Lazy::Lockfile; my $process = "EnrolleeSummaryBuilder"; my $database = "Alpha"; my $schematxt = "CLIENT1"; my $lockfile = Lazy::Lockfile->new(location => "/tmp/$process-$database-$schematxt.lock") || exit 1; <STDIN>;