|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: How do I trap $SIG{INT} ( sigint aka Ctrl^c )?by LH2007 (Initiate) |
| on Oct 25, 2007 at 14:40 UTC ( [id://647189]=note: print w/replies, xml ) | Need Help?? |
|
How to terminate a childprocess by press Ctrl_c:
Creat 2 process,P1(parent),P2(child).P1 gets characters from keyboard.If press Ctrl-C,P1 will send a signal to terminate P2....
I think,I can use a subroutine to response to Ctrl-C combination:
code$SIG{INT} = \&killproc;
sub tsktsk {
$SIG{INT} = \&killproc;
............
}
/code
Please help me.Thanks
Originally posted as a Categorized Answer.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||