or more readably$| = 1;
will solve the problem for a pipe that has only Perl scripts in it. It needs to go on the stdout of each script in the pipe. (My experience so far has always been that the stdin side of a pipe will read the next line when the line feed arrive, but you may want to check that with your operating system...and your Perl version, and your C libraries...)use English '-no_match_vars'; $OUTPUT_AUTOFLUSH = 1;
Some other common utilities will work in pipelines, but some insist on buffering their output. Which utilities are which? It's probably simpler to find out by experiment than to find the documentation, if it exists.
If you find that grep or cut on your system are holding their output in buffers, just rewrite them as perl scripts.
In reply to Re^2: Using pipe and reading from the stdin (buffering)
by quester
in thread Using pipe and reading from the stdin
by mellin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |