to your program up at the top, everything exits fine on SIGINT, and the end block is executed:sub sigint { die "Dying."; } $SIG{INT} = \&sigint;
You probably want to do something other than die(), but same idea. SIGCHLD (ignored by default) will catch child deaths, if that's what you wanted originally.$ perl test.pl processing sleep(0) in thread 1 processing sleep(1) in thread 1 processing sleep(3) in thread 3 processing sleep(0) in thread 4 processing sleep(2) in thread 4 processing sleep(4) in thread 2 processing sleep(0) in thread 1 processing sleep(3) in thread 1 processing sleep(4) in thread 4 processing sleep(5) in thread 3 <C-c> Dying. at test.pl line 25. END block executed A thread exited while 3 threads were running.
In reply to Re: END block not excuting when thread interrupted
by jrockway
in thread END block not excuting when thread interrupted
by iankorf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |