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
In reply to Re^6: Print inside SIGNALS
by haukex
in thread Print inside SIGNALS
by pedrete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |