good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Preventing multiple instancesby davido (Cardinal) |
on Jun 04, 2021 at 15:44 UTC ( [id://11133520]=note: print w/replies, xml ) | Need Help?? |
Good question. My thought process when I wrote that was that having the process already running wasn't an exceptional event. It might be noteworthy, but not worthy of a non-zero exit code. But that's entirely subjective to the use-case. I had recently been working on something where it was fairly normal behavior for an instance already to be running, and for that to be a perfectly acceptable situation. So that's really it. A die would be fine too, but would (on a POSIX system) result in an 11 exit code, resource temporarily unavailable. By separating the message from the termination I went the other direction where the exit code is zero, while STDERR still gets a little quip. Dave
In Section
Seekers of Perl Wisdom
|
|