Hi haukex,
I have run your program and I keep getting 2 as a result too (on Linux)
I've tried to create something that also works on Windows:
alarm 2; $SIG{ALRM} = \&Finish; print "Sleep 5\n" ; sleep 5 ; sub Finish { print "Sleep 5 sig\n" ; sleep 5 ; print "Timeout reached\ +n"; } __END__ Sleep 5 Sleep 5 sig Timeout reached
You have to actually run this to see that it runs for 10 seconds. This shows that the first sleep is actually suspended and the sleep inside the Finish routine is executed, once if finishes it continues to execute the other previous sleep.
Yesterday I was testing on Linux and Windows back and forth and I think I got confused somewhere. It is clear to me that Windows behaves very different if it comes down to signals. I know that the OP asked for Linux assistance as well, so my response right now may be off topic I know.
In reply to Re^14: Print inside SIGNALS
by Veltro
in thread Print inside SIGNALS
by pedrete
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |