in reply to
Undefined value returned on call to readline (<>)?
In case you're open to other ideas, I suggest getting rid of pid files entirely and using a service supervisor like s6 or Runit.
Benefits of Runit design
Features of s6 vs. other options
Comment on
Re: Undefined value returned on call to readline (<>)?
In Section
Seekers of Perl Wisdom