Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Conditional Lock File

by roboticus (Canon)
on Feb 02, 2011 at 19:53 UTC ( #885838=note: print w/ replies, xml ) Need Help??


in reply to Conditional Lock File

bichonfrise74:

It looks like you have most of it. All you'd need to do is pass in a different lockfile name if there's an argument vs. without one. Perhaps something like:

my $lockfile = '/tmp/my.lockfile'; $lockfile .= '.with_arg' if $fl_has_arg; check_process($lockfile) and die "Already running!";

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: Conditional Lock File
Download Code
Re^2: Conditional Lock File
by bichonfrise74 (Vicar) on Feb 02, 2011 at 20:35 UTC
    Thanks. Your suggestion worked perfectly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885838]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2014-09-22 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls