http://qs321.pair.com?node_id=219894


in reply to nonblocking char reads from OUTPUT stream from open3

ReadKey supposes that the filehandle refers to a terminal (TTY), not to a pipe (which is what Open3 gives you).

The error you reported means (more or less): what you gave me is not a terminal, can't do anything with it.

Try setting autoflush(1) on the filehandle.

-- 
        dakkar - Mobilis in mobile

Replies are listed 'Best First'.
Re: Re: nonblocking char reads from OUTPUT stream from open3
by Eradicatore (Monk) on Dec 14, 2002 at 23:07 UTC
    Thanks for the reply. I think I already set this. You say autoflush on the filehandle, but I'm not sure that is exactly what you meant. I don't think you can set autoflush on a specific filehandle can you? I just set $| to 1.

    Anyway, this still wasn't solving the problem. I started out actually with getc(), because I figured that with autoflush on, there would be no way I wouldn't get all the chars up to the point where this seperate process typed out the line (without a carriage return) with the wait for a "y" or "n". But for some reason, just on that one line, the getc() stopped working it seemed.

    Justin

      You can set autoflush on a single handle:

      use IO::Handle; autoflush FH 1; # first way FH->autoflush(1); # OO-ish way

      But anyway, that's not what you need (I just tried). I just don't know how to do it... sorry

      -- 
              dakkar - Mobilis in mobile