in reply to Change in config from outside ==> immediate reflection?
One is to just change the sleep interval to 0.1 or 0.05 seconds (use Time::HiRes for that), and only perform light weight checks in your "event loop" (for example check timestamps, and if a timestamp changes you can read a file again).
A slight variation is to install handlers for SIGUSER1 or other user specific signals, and sens a signal from to the long running application whenever you change something. See perlipc for more inspiration.
Another approach is to use an event framework like POE that does all the hard stuff for you: it can monitor files, set timeouts and all that stuff.
|
|---|