in reply to Re^2: Timeout on STDIN
in thread Timeout on STDIN

No experience of my own, but the reply to Problems with Term::ReadKey suggests that you might have to set
$| = 1;
for STDIN.

Replies are listed 'Best First'.
Re^4: Timeout on STDIN
by boleary (Scribe) on Oct 24, 2016 at 10:52 UTC

    Thanks... I thought I had that set but I didn't I tried again with

     $|=1  $msg=<STDIN>

    still works

    but the ReadKey never seems to get characters

    $key = ReadKey(1);

    My script is being opened as a child of another process and that process prints strings to stdin (not using a keyboard)

      Then perhaps not STDIN of your (child) script, but STDOUT of the parent script (or whatever its corresponding file handle is) may be buffered?

        I believe STDOUT from my parent always flushes (so <STDIN> always works if the parent is working)

        My problem occurs if the parent hangs, because the child process then hangs waiting for <STDIN>

        So I was hoping for a way to be able to timeout waiting for <STDIN>