readline (aka <>) reads until a newline or eof is encountered before returning. You want sysread since it returns as soon as data is available.
for (;;) { my $read = sysread($fh, my $buf, 64*1024); die("Can't read from pipe: $!\n") if !defined($read); last if !$read; print $buf; }
In reply to Re: Nested line buffered output
by ikegami
in thread Nested line buffered output
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |