$SIG{'INT'} = sub {print "Caught One!\n"}; while(1) { sleep 1; }
On ActivePerl 5.6.1/Win32, the program is exited the second time you press ctrl-C. Apparently the signal handler gets cleared... setting the signal handler again makes it work again. Of course, there will still be a short crack where it's still vulnerable.
On ActivePerl 5.8.3, it keeps working.
In reply to Re^2: How do we capture CTRL^C
by bart
in thread How do we capture CTRL^C
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |