in reply to Re^2: Nested line buffered output
in thread Nested line buffered output
#!/usr/bin/perl use strict; use warnings; $|=1; my $p2 = "./p2.pl"; open(P2,"$p2 |") || die "P2: $p2 - $!\n"; while( read( P2, $_, 1 ) ) { # fixed as per [ikegami]'s post below print; }
BTW, you should probably be using a lexical filehandle, but given the short example I won't complain too loudly. ;-)
Update: fixed bug in read as pointed out by ikegami in Re^4: Nested line buffered output.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Nested line buffered output
by ikegami (Patriarch) on Jun 01, 2010 at 18:38 UTC | |
by mr_mischief (Monsignor) on Jun 01, 2010 at 19:31 UTC | |
by ikegami (Patriarch) on Jun 01, 2010 at 20:11 UTC | |
by mr_mischief (Monsignor) on Jun 02, 2010 at 05:52 UTC |