Submitting to the discipline of unix line in a DOS application is a luxury, not a right.
It obeys Ctrl+Break
, which is the equivalent of Windows Ctrl + C
Change Changed to Ctrl + Break - this is what I get to use the Mac keyboard.
In order to test the processing of interruptions, you should use the following loop in your working part, because otherwise it waits until all sleep completes before the handler starts:
sub work { print "working..."; my $i = 0; while ($i < 10) { sleep(1); $i--; } say "done." }
Thus, it is easier to detect keystrokes - interrupt handling is not detected during sleep.
Color confused me - the INT handler works now!
Change The source code for perl claims that it should support HUP as a window close event, but the event does not seem to get delivered when I click on the close CMD window
source share