esharris has asked for the wisdom of the Perl Monks concerning the following question:

Can the subroutine DBI::execute disable a timer interrupt $SIG{ALRM}? I set up a timeout handler using $SIG{ALRM} and I use alarm to set the timer. However, it appears that the timeout will NOT occur while a DBI::execute call is executing a query. In the past, I noticed that, when I use DBI subroutines in a Perl script, I can't halt the script's execution with a ctrl-C. My conjecture is that DBI::execute turns off interrupts. I can't find any literature to confirm my conjecture. If my conjecture is valid, it there a way to prevent the disabling?

Replies are listed 'Best First'.
Re: $SIG{ALRM} and dbi::execute
by diotalevi (Canon) on Feb 18, 2004 at 19:27 UTC
    The newer signal handling system only checks for them between op calls. A number of DBI's methods are calls out to C libraries so perhaps you just have to wait for perl to restart for your signal to be handled.