•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 456,557 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,433 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 933 | Replies: 0
![]() |
| |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
hi everybody!I'm newbie.I have a exercise about perl like this:
Creating 2 process P1(parent) P2 (child)
P1 get characters from keyboard
If press Ctrl-c P1 send a signal terminate P2
......................................
My ideal is :
But my problem is press Ctrl-C.I think,can i creat a subroutine to respond to Ctrl-C like that:
Please help me
Creating 2 process P1(parent) P2 (child)
P1 get characters from keyboard
If press Ctrl-c P1 send a signal terminate P2
......................................
My ideal is :
( perl )
$handle=IO::Socket::INET->(proto=>"tcp",
PeerAddr=>$host,
PeerPort=>$port)
$handle->autoflush(1);
die 'can't fork:$!' unless defined($pid=fork());
if($pid) {
while(defined($line=<$handle>)){
print STDOUT $line;
}
kill("TERM"=>$pid);
}But my problem is press Ctrl-C.I think,can i creat a subroutine to respond to Ctrl-C like that:
$SIG{INT}=\&killchild;
sub killchild{
.............
}
Please help me
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- win32 Perl CCD camera capture, is it possible? (Perl)
- unclosable process firefox.exe or iexplore.exe (Viruses, Spyware and other Nasties)
- perl inline module (Perl)
- Task manager NOT working ( need HELP =[ ) (Viruses, Spyware and other Nasties)
- Hijacked browser (Viruses, Spyware and other Nasties)
- HijackThis log (Viruses, Spyware and other Nasties)
- My Personal Horoscope crap... (Viruses, Spyware and other Nasties)
Other Threads in the Perl Forum
- Previous Thread: Correct my code plz
- Next Thread: New to Perl, please explain the script


Hybrid Mode