laziness, impatience, and hubris | |
PerlMonks |
Re^3: Controlling a Perl Daemon with Signalsby jch341277 (Sexton) |
on Aug 08, 2005 at 15:27 UTC ( [id://481912]=note: print w/replies, xml ) | Need Help?? |
I've made some other changes to the code to illustrate what sk and I are talking about.
The handlyn() gives me time to send a kill to the process which I'm running from the perl debugger. I then issue a "c 13" in the debugger and wait for the "NOT handling" to be printed, send a kill and then step into the script using "s". You'll see that when $handling_request == 1, the script will exit from line 15. When $handling_request == 0, the script exits from line 29. Which I think is how you want it? The question is - how does your handle_request work? Is it able to deal with being interrupted only to have execution return to some arbitrary line in the subroutine? What I've done here is to control where the interrupt will occur by giving myself time to send the interrupt at that particular line. But, that isn't how signals generally work in the wild... Update: corrected link.
In Section
Seekers of Perl Wisdom
|
|