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
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;
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"; }
|
|---|