in reply to Practical Proc::Daemon example

How do I use proc::daemon if Database connection is involved in script. Lets say I want to write a daemon which polls DB inserts and if a new insert happens #dosomething. Should I make a DB connection in while(1) in above example. I believe it will make DB connection in each iteration. Please bless.

Replies are listed 'Best First'.
Re^2: Practical Proc::Daemon example
by 1nickt (Canon) on Apr 02, 2017 at 17:17 UTC

    Have you looked at DBI's connect_cached() ? Used with care it can help in a situation like yours.


    The way forward always starts with a minimal test.