in reply to Non blocking read from the console
I am using Win 10 and Perl version 5.32.
I am using Linux and perl v5.34.0 and your code as given runs perfectly.
🦛