jiemi has asked for the wisdom of the Perl Monks concerning the following question:
However, when I write to my named pipe with another program, output will not appear from my perl script above until I send an EOF to the pipe. I ran truss on my perl script, and I see it reading in the data as each line is fed to the pipe, but it doesn't do any writing until the EOF goes to the pipe from the other program which is writing to the pipe. Is this due to some kind of buffering issue? Any way to accomplish this? Thanks!use FileHandle; $tmpfile = "/var/tmp/fifotest"; open (FIFO, "$tmpfile"); STDOUT->autoflush(1); FIFO->autoflush(1); print <FIFO>; close (FIFO);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: line by line reading named pipes
by jethro (Monsignor) on Feb 05, 2011 at 03:41 UTC |