in reply to prompt and timeout in tests

You probably want to use the Term::ReadKey module.