in reply to Re^9: Print inside SIGNALS
in thread Print inside SIGNALS
Don't kill the program (e.g. by sending SIGINT to the program) and then complain that the rest of the program (e.g. the signal handler) doesn't run.
I didn't.
$ perl -e 'sleep 10;print"World\n"' | perl -e '$x=time; $SIG{ALRM}=sub{print"Hello ";$y=time}; alarm 2; $z=<>; print $z,$y-$x," ",time-$x,"\n"' Hello World 2 10
On my system, all of the above output does not happen until after 10 seconds. See above.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Print inside SIGNALS
by Veltro (Hermit) on Jul 19, 2018 at 11:05 UTC | |
by haukex (Archbishop) on Jul 19, 2018 at 17:34 UTC | |
by Veltro (Hermit) on Jul 19, 2018 at 20:09 UTC | |
by haukex (Archbishop) on Jul 19, 2018 at 21:17 UTC | |
by Veltro (Hermit) on Jul 19, 2018 at 21:46 UTC | |
| |
by ikegami (Patriarch) on Jul 20, 2018 at 18:48 UTC | |
| |
by ikegami (Patriarch) on Jul 20, 2018 at 18:44 UTC | |
by haukex (Archbishop) on Jul 20, 2018 at 19:25 UTC | |
by kcott (Archbishop) on Jul 20, 2018 at 20:44 UTC | |
by haukex (Archbishop) on Jul 20, 2018 at 20:48 UTC | |
by pryrt (Abbot) on Jul 20, 2018 at 19:52 UTC | |
by haukex (Archbishop) on Jul 20, 2018 at 20:28 UTC | |
by Veltro (Hermit) on Jul 20, 2018 at 20:00 UTC | |
by haukex (Archbishop) on Jul 20, 2018 at 20:37 UTC | |
| |
|
Re^11: Print inside SIGNALS
by ikegami (Patriarch) on Jul 20, 2018 at 18:43 UTC | |
by haukex (Archbishop) on Jul 20, 2018 at 18:58 UTC |