}elsif($pid == 0){ # This is the child, it will log when the parent is done while(!&parentIsDead){sleep(10);} # &finalLog($traceFileToLog); &finalLog($traceFileToLog, $initialString); exit(0); sub parentIsDead { if(getppid()==1){ return 1; } return 0; }