in reply to Timing user input

Take a look at Prompt::Timeout, it seems to do exactly what you want.