Sigh... I said I was done, but this really is bothering me. Sorry for my flurry of replies just now.
The signal handler is only called between Perl ops, so it can't be called until <> returns
All I'm asking is if you could please grab a Linux box and run this yourself:
$ perl -wMstrict -le '$a=time;$SIG{ALRM}=sub{$b=time};alarm 2;<>;print + $b-$a'
I've tried it lots of times, and no matter how long I wait (Update: as long as it's >2s) to input something (or nothing) and hit enter, the output is invariably 2. The only conclusion I can draw anymore is that this is because the handler fires during <>. I've really done a lot to test this myself - run this under strace, tried lots of different variations of the above onliner, etc.
All the evidence I've gathered, some of which I've presented, points to <> being interruptible. You keep insisting it isn't, so please, could you show your evidence (=code)? At this point I'd be relieved to be proven wrong. Please don't leave us hanging here.
Minor edits to wording.
Update: Thanks everyone. Next time I'll ask for a reality check sooner, before letting my frustration get the better of me. (I'm waiting for the vote fairy.)
In reply to Re^13: Print inside SIGNALS (updated)
by haukex
in thread Print inside SIGNALS
by pedrete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |