It is a bad idea to do I/O inside an interupt handler. You should set a flag, then return. In your code, check the flag value and act accordingly if it's set. This doesn't address your problem directly, but it seems to be sound advice and worth mentioning here.
Notice this snippet from perlipc:
For example, to trap an interrupt signal, set up a handler like this. Do as little as you possibly can in your handler; notice how all we do is set a global variable and then raise an exception. That's because on most systems, libraries are not re-entrant; particularly, memory allocation and I/O routines are not. That means that doing nearly anything in your handler could in theory trigger a memory fault and subsequent core dump.the signal(7) manpage lists a table of signals by name along with their values, actions and descriptions.
conv
In reply to Re: signal trapping
by converter
in thread signal trapping
by Seshouan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |