philkime has asked for the wisdom of the Perl Monks concerning the following question:
This is using IPC::Run to run the command. I am running many commands, some taking more than 20 seconds but the message "TIMEOUT ALERT" never appears in the log and all commands run to completion as normal. I don't want to kill anything (contrary to most alarm() examples I find), I just want to let the command run but send some warning somewhere if it takes X amount of time. Is there something obviously wrong here?local $SIG{ALRM} = sub { write_log('TIMEOUT ALERT'); }; alarm 20; my ($run_ok, undef, $full_buf, undef, undef) = run(command => $cmd); alarm 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $SIG{ALRM} to just log something?
by kcott (Archbishop) on Apr 17, 2014 at 01:20 UTC | |
|
Re: $SIG{ALRM} to just log something?
by Anonymous Monk on Apr 16, 2014 at 20:27 UTC | |
|
Re: $SIG{ALRM} to just log something?
by zentara (Cardinal) on Apr 17, 2014 at 17:36 UTC | |
|
Re: $SIG{ALRM} to just log something?
by Bloodnok (Vicar) on Apr 17, 2014 at 09:41 UTC |