sub WaitForInput { while (not defined ($key = ReadKey(-1))) { ## just waiting for input } $key .= ReadKey(-1); $key .= ReadKey(-1); }