$pid = open2($chldout, $chldin, $cmdstring); while(<$chldout>){ #process script output strings $mytime=time; watchdogQ->enqueue("$pid $mytime"); #"pet the watchdog" } #use $? to determine timeout case or not