in reply to Non-blocking pipe write
use strict; use warnings; use IO::Socket; my $handle; my $pid; if (!defined($pid = open($handle, "|-"))) { die "Fork failed: ".$!; } elsif ($pid == 0) { # Child stdin->blocking(0); sleep(5); exit 0; } else { # Parent $handle->autoflush(1); $handle->blocking(0); my $i = 0; my $result; do { $result = print $handle "ABC\n"; print "PIPE write ".++$i."\n"; } while ($i < 10000); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Non-blocking pipe write
by Marcello (Hermit) on Nov 04, 2004 at 18:37 UTC | |
by borisz (Canon) on Nov 04, 2004 at 19:41 UTC | |
by melora (Scribe) on Nov 05, 2004 at 01:39 UTC |