Marcello has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use IO::Socket; my $handle; my $pid; if (!defined($pid = open($handle, "|-"))) { die "Fork failed: ".$!; } elsif ($pid == 0) { # Child sleep(5); exit 0; } else { # Parent $handle->autoflush(1); my $i = 0; my $result; do { $result = print $handle "ABC\n"; print "PIPE write ".++$i."\n"; } while ($result); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non-blocking pipe write
by ikegami (Patriarch) on Nov 04, 2004 at 16:16 UTC | |
by Marcello (Hermit) on Nov 04, 2004 at 18:58 UTC | |
by BUU (Prior) on Nov 04, 2004 at 19:29 UTC | |
|
Re: Non-blocking pipe write
by borisz (Canon) on Nov 04, 2004 at 16:54 UTC | |
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 | |
|
Re: Non-blocking pipe write
by iKnowNothing (Scribe) on Nov 07, 2004 at 01:18 UTC | |
|
Re: Non-blocking pipe write
by tsmoyers (Pilgrim) on Nov 05, 2004 at 20:08 UTC |