in reply to Practical Proc::Daemon example

Interesting ... could you please note, in the above posting, exactly what was not-obvious to you? It sounds like you ran into, and overcame, some obstacles along the way. Can you please elaborate (outside of the expandable block) just what those were and what you did about it? (Given that your audience hasn't yet run into those rocks, it isn't quite clear from your post just where they are.)

Replies are listed 'Best First'.
Re^2: Practical Proc::Daemon example
by jellisii2 (Hermit) on Feb 05, 2014 at 13:43 UTC

    There is a lack of examples for how to use the module, from my digging. While the documentation is complete, the lack of practical examples made it hard for me to envision how exactly to accomplish what I wished to do. I will freely admit to being spoiled by the great documentation on modules like XML::Twig :D.

    The Init method (still, less so than before, though) has the appearance of voodoo; Timing of its call seems to be very important, particularly if you want to limit the daemon to a single instance, which for my purposes is important as the task that I'm firing is exceptionally cpu intensive and long running. This tripped me up QUITE a few times until I realized I could call Status without having to do an Init. This blindingly bright lightbulb allowed me to get the important stuff (start, stop, status) to behave the way I desired.

    While the terse example on the documentation is valid, it was so far away from my use case (limit to single instance), I couldn't align it with what I wanted to do. The example above was my path to discovery of how to fix my ignorance.