in reply to Re: Nested line buffered output
in thread Nested line buffered output
p2.pl#!/usr/bin/perl use strict; use warnings; $|=1; my $p2 = "/tmp/p2.pl"; open(P2,"$p2 |") || die "P2: $p2 - $!\n"; while(<P2>) { print; }
The output of p2.pl is 1 dot every second for 10 seconds but the output of p1.p1 is 10 dots after 10 seconds. Thanks.#!/usr/bin/perl use strict; use warnings; $|=1; my $i; for $i (1..10) { print "."; sleep 1; } print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Nested line buffered output
by mr_mischief (Monsignor) on Jun 01, 2010 at 18:31 UTC | |
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 |