Subject: | when i kill child process, the run function will still be waiting timeout. |
I set timeout in run function.After I start my main process, I kill the
child process, and I found the main process still waiting for a timeout.
Here is the code of Main.pl:
#!/usr/bin/perl -w
use strict;
use IPC::Run qw( timeout run ) ;
my @exe = ("./child.pl");
eval{
run(\@exe,timeout(20));
}
if ($@){
print $@;
}
Here is the code of child.pl
#!/usr/bin/perl -w
use strict;
sleep(10);# kill the process at this time
print "hello world\n";