in reply to Nested line buffered output

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; }

Replies are listed 'Best First'.
Re^2: Nested line buffered output
by Anonymous Monk on Jun 01, 2010 at 20:55 UTC
    Thank you all for the replies. The sysread example worked exactly as I needed it to.