If you want to pass the arguments at startup time, then the answer is "just the same as with any other Perl program".
If not, you need some form of IPC (inter-process communication). perlipc provides a good overview and many examples.
| [reply] |
In addition to what moritz said: A common way to pass data to a daemon is to use a config file. If you need to update the file while the daemon is running, a common practice is to send the daemon a SIGHUP. From the Perl side, this can be trapped by
$SIG{HUP}=sub { .... };
--
Ronald Fischer <ynnor@mm.st>
| [reply] [d/l] |
To amplify on what moritz said about ipc, using a socket is a good way.
| [reply] |
If you want to speak to daemons, a nice introduction is Ars Goetia which lists 72 different daemons and the rituals and incantations to use in conversing with them.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] |