in reply to getting data to a signal handler
We're stuck with globals for that. The only argument a handler gets is the name of the signal that fired it.
Since we don't know where in the code a handler will fire, only global variables can be relied on to be visible to the handler. It's best if they are not file-level lexicals. That produces a closure with the handlers which use them, occasionally producing hard-to-debug "features".
Added: The first section of your local perlipc is on signal handling, and is full of great tips and tricks.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getting data to a signal handler
by pileofrogs (Priest) on Nov 19, 2005 at 02:52 UTC | |
by Zaxo (Archbishop) on Nov 19, 2005 at 03:13 UTC | |
by jonadab (Parson) on Nov 19, 2005 at 12:32 UTC |