See Term::ReadKey.
In reply to Re: read from stdin by BrowserUk in thread read from stdin by mitchreward