in reply to Non blocking read from the console

Also works (im)perfectly fine on Windows 11 with both the command prompt (CMD) and Powershell.

I decided to try running it in the most convoluted way I could think of and, as a subprocess of another app, I get the same message you reported. Are you running this in a way where the standard file handles are actually being piped to/from between a perl process and a pseudo-terminal?

Replies are listed 'Best First'.
Re^2: Non blocking read from the console
by jmClifford (Beadle) on Oct 19, 2024 at 01:13 UTC

    Hi. My console input (I suppose) is what ever comes with the Eclipse IDE software and uses Stawberry Perl.

    Regards JC....

      Try running it from the command prompt, not in the IDE's fake terminal.

        Hi. Ta. It does work (in CMD mode). I had to add a "\n" to avoid the buffering of characters. Some console output follows (involving this change).

        C:\u\Perl_Eclipse_IDE\OBD2_control> C:\u\Perl_Eclipse_IDE\OBD2_control>perl Note_02_NonBlockingSTDIN.pl start finish ...........Get key K C:\u\Perl_Eclipse_IDE\OBD2_control> C:\u\Perl_Eclipse_IDE\OBD2_control> C:\u\Perl_Eclipse_IDE\OBD2_control>perl Note_02_NonBlockingSTDIN.pl start finish . . . . . Get key N

        But I find it dis-appointing to lose the convenience of running from the IDE. Are there other IDEs that would accommodate ?

        Regards JC....