I'd like to use a while construct to loop until a key, any key, is pressed. I'm aware of the <STDIN> source for input, but with what function do I check for key presses regardless of <Enter>?
Use the CPAN module Term::ReadKey, and try to read a key in non-blocking mode by passing it an argument of -1
if (defined ($char = ReadKey(-1)) ) { # input was waiting and it was $char } else { # no input was waiting }