This might be of use
Readkey with timer using Glib. The problem with Term::Readkey, is it needs a controlling loop, which make interfere with running code in the main block of code. BUT.... if you put the Readkey stuff in a thread, it will work fine, and you can use the main code block to do whatever. I added GLib so you can run timers or filehandles watches.