It may be that the getc man page will point you in the right direction. The tricky part will be in setting and reverting terminal modes without employing a module like Term::ReadKey.
Cheers,
JohnGG
Comment on Re: Read from STDIN and stay on same line