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