in reply to Re^5: Print inside SIGNALS
in thread Print inside SIGNALS
First snippet: <> can't be interrupted because there's no way to check <> for errors. However, the signal handler does get called once it returns.
At least on my machine (Linux), it seems to be the same buffering issue...
$ perl -wMstrict -e 'alarm 2; $SIG{ALRM}=sub{ print "Timeout reached" };<>' ^C $ perl -wMstrict -e 'alarm 2; $SIG{ALRM}=sub{ print "Timeout reached\n" };<>' Timeout reached ^C $ perl -wMstrict -e 'alarm 2; $SIG{ALRM}=sub{ print STDERR "Timeout reached" };<>' Timeout reached^C
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Print inside SIGNALS
by ikegami (Patriarch) on Jul 17, 2018 at 16:18 UTC | |
by haukex (Archbishop) on Jul 17, 2018 at 18:14 UTC | |
by ikegami (Patriarch) on Jul 18, 2018 at 11:20 UTC | |
by haukex (Archbishop) on Jul 18, 2018 at 14:40 UTC | |
by Veltro (Hermit) on Jul 19, 2018 at 11:05 UTC | |
| |
by ikegami (Patriarch) on Jul 20, 2018 at 18:43 UTC | |
|