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
In reply to Re: getting data to a signal handler
by Zaxo
in thread getting data to a signal handler
by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |