in reply to Re: Need a reliable way to send SIGINT to a perl process on 5.8.8/windows XPpro
in thread Need a reliable way to send SIGINT to a perl process on 5.8.8/windows XPpro

Interesting, so using the Break instead, my current acceptance test case seems to interrupt correctly in many cases although I get wild exit codes some times.
However, trying just a simple test, this still does not work. For instance I have 2 scripts running in parallel, using one to attempt to send the signal to the other:
WaitForCtrlC.pl:
use strict; use warnings; $SIG{INT} = sub {print "got ctrl-C in waitforctrlc\n"; exit 1;}; print "\nmy pid is $$\n"; while (1) { print "waiting for ctrl-C\n"; sleep 2 } # should never get here print "made it past ctrl-C\n"; exit 0;

And then send the signal to the pid with SendCtrlC.pl:
use strict; use warnings; while (1) { print "Enter pid to signal:"; my $pid = <STDIN>; chomp $pid; print "\nSending signal to $pid:..."; kill 21, $pid; print "\n"; }