$cmd="$scriptsdir/process_tar.pl $file >> /tmp/testlog &"; $pid=open(PID,"|$cmd"); if(pidrunning($pid){ print "PID $pid is running"; }else{ print "PID $pid is not running"; } # check if process is running sub pidrunning{ ($pid)=@_; $exists = kill 0, $pid; return $exists; }