open TEST, "perl $d $dir\\ControlC\\ControlC.pl $block $job \$reslist=$reslist \$timeout=10 $retry |"; # capture stdout from client under test my $output = ''; while () { $output .= $_; if ( /waiting for control c/i ) { $SIG{INT} = 'IGNORE'; #kill "INT", $pid; $console->GenerateCtrlEvent(); Win32::Sleep(100); $SIG{INT} = 'DEFAULT'; } } close TEST;