in reply to IPC::Open3 buffering and autoflush
The problem with standard I/O buffering is though your output filehandle is autoflushed so the process on the other end will see your data in a timely manner, you can't usually do anything to force it to return the favor. In some cases, for example "bc -l", it expects to operate over a pipe so therefor it flushes each output line, but it often seldom works this way unless you wrote the program yourself ( As you did with the script and turned off buffering on STDOUT). Various interactive programs also fail here, like FTP which wont do line buffering on a pipe, only on a TTY device.
As mentioned, the IO::Pty and Expect modules provide a pseuedo-tty device, giving you line-buffering without needing to modify the program on the end of the pipe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPC::Open3 buffering and autoflush
by morpheus (Initiate) on Jan 07, 2010 at 13:55 UTC |