I wish to read a key (other than ENTER) from the keyboard. Is there a way to modify the behaviour of <STDIN> so that it returns each keystroke in the stream, without waiting for ENTER?
Note: we can assume this code will always run on a Linux box.
Note 2: I see that there is a Perl module (Term::Readkey) that can do this. My system does not have this module by default, so I presume others also don't. When developinging, I prefer to write my code as dependency-free as possible. This is why I'm trying to 'reinvent' this wheel.
-with thanks
Mike
Note: we can assume this code will always run on a Linux box.
Note 2: I see that there is a Perl module (Term::Readkey) that can do this. My system does not have this module by default, so I presume others also don't. When developinging, I prefer to write my code as dependency-free as possible. This is why I'm trying to 'reinvent' this wheel.
-with thanks
Mike