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 = ; chomp $pid; print "\nSending signal to $pid:..."; kill 21, $pid; print "\n"; }