while ( (not defined ($key = ReadKey (0))) && ($dead != -1) ) { $dead = waitpid(-1,&WNOHANG); }