...so that if the worker takes too long
What exactly is taking too long? I.e., does the worker program stop delivering output, so that the $str = <WORKER> blocks, or does it just keep outputting lines for too long? In the latter case, I wouldn't expect the alarm to work, because the alarm is always being reset immediately after the read (which takes almost no time if it succeeds)...
An alternative to the alarm approach would be to fork and have the child kill the external process after a while. (I'll post an example later (unless someone else has already done so by then) — it's lunch-time here...)
In reply to Re: Cannot catch ALRM signal for timeout
by almut
in thread Cannot catch ALRM signal for timeout
by Magice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |