go ahead... be a heretic | |
PerlMonks |
Re: send ctrl+c to open3?by zentara (Archbishop) |
on Jul 18, 2014 at 09:12 UTC ( [id://1094187]=note: print w/replies, xml ) | Need Help?? |
I'm not sure about the CNTRL-C being the best or easiest way to stop the process being run by open3. IPC::Open3 returns a PID, so what you might want to try is intercept the CNTRL-C in the parent, then use Proc::Killfam to killfam 9, $pid;
The killfam is used to get all shells and children related to the $pid in question. Often, the $pid returned by open3, is just a shell used to run your actual program. Here is how to grab cntrl-c in your main. You can google for many examples of using Proc::Killfam, I won't repeat them here. I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh
In Section
Seekers of Perl Wisdom
|
|