Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Checing presence of input on standard input in non-blocking way, sans user interactionby marinersk (Priest) |
on Jul 17, 2013 at 15:35 UTC ( [id://1044846]=note: print w/replies, xml ) | Need Help?? |
If I read you correctly, you are looking for a Perl version of the BASIC $Inkey function.
I think in C it was usually the keyPress() function. In other words, you want to be able to see if there's a reason to process input without stopping your program to wait for it. AND you want it to work even if the user had redirected input. There is no pure Perl solution to this that I'm aware of -- over the years, I have checked from time to time. Not sure why you wish to avoid using Term::Readkey but without that I would expect you to not find a solution. If you do find one, I'd personally appreciate knowing about it here on Perlmonks. Good luck in the hunt!
In Section
Seekers of Perl Wisdom
|
|