The problem with this is that the alarm signal will then simply kill the script... (which is the default action for SIGALRM)
| [reply] |
local $SIG{ALRM} = sub { print STDERR "hey\n" };
Ie, there is a difference in behaviour between that and set_sig_handler().
Whoops, no there isn't, but adding STDERR reporting does shed some light on when the alarm fires... | [reply] [d/l] |
Have you tried it? AFAICT, this still doesn't do what the OP wants.
Instead of the script getting killed, when the alarm fires, it now prints "hey" to STDERR, and then still goes to wait 60 seconds until the suprocess completes by itself.
| [reply] |