- or download this
kill INT => $pid;
# which is the same as
kill 'INT', $pid;
- or download this
$SIG{INT} = sub {
# code executed on 'INT' signal here
}; # <-- that semicolon isn't optional
- or download this
{
my $stop = 0;
...
}
# our old SIGINT handle is restored here, because we
# left the old block.