Skip Menu |

This queue is for tickets about the Proc-PID-File CPAN distribution.

Report information
The Basics
Id: 24739
Status: new
Priority: 0/
Queue: Proc-PID-File

People
Owner: Nobody in particular
Requestors: develop [...] traveljury.com
Cc:
AdminCc:

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



Subject: Use multiple PID files in one process
Hiya Proc::PID::File is a great little utility, so great that I want to use it multiple times in a single process... I'm using it to only allow a single instance of cronjob X to run, but I also want to be able to lock a working dir, so that manual job Y can't run on the same dir. Unfortunately, your use of a scalar $self prevents me from doing so. I think that really, you only want to make sure that there is a single version of each PID file. I suggest the following: - instead of declaring a package wide my $self, use: my %selves - then, in sub running, do the following: sub running { my $self = shift->new(@_); my $path = $self->{path}; $self = $selves{$path} ||= $self;