http://www.perlmonks.org?node_id=927947


in reply to Ask for STDIN but don't pause for it

You might take a look at a terminal module like Term::ReadKey to get started. I would run a loop, timer, or event architecture to periodically check for input and react accordingly.

Should you want to go down the event route, AnyEvent bills itself as the DBI of event processing and is a good place to start.