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