in reply to Communicating with unflushed child process

UPDATE:
the code doesn't work, the problem was that <CHILD> reads upon \n and with a prompt, that could be a problem.

too hasty post:
i've been messing around in your code and this seems to work:

use Socket; use IO::Handle; use POSIX ":sys_wait_h"; my $childPid; socketpair(CHILD, PARENT, AF_UNIX, SOCK_STREAM, PF_UNSPEC); CHILD->autoflush(1); PARENT->autoflush(1); die "no child fork" unless defined($childPid=fork()); if ($childPid){ shutdown(PARENT,0); print "about to read\n"; while (<CHILD>){ last if (/Are you ready\? > /); print "got $_"; } print PARENT "yes\n"; print "we're ready\n"; } else { print "waiting for pid..\n"; } open(STDOUT, ">&",PARENT) or die "Can't dup stdout: $!\n"; open(STDIN, "<&",PARENT) or die "Can't dup stdin: $!\n"; exec "./fill.pl" or die "Can't start my program: $!\n"; shutdown(CHILD,1);
and i used this as the fill.pl:
#!/usr/bin/perl print <<END; bla bla bla bla bla bla lb alb blla bla bla bla bla bla END ASK: print "Are you ready? > \n"; $a=<STDIN>; if ($a =~ /yes/) {print "bla bla bla";exit 0;} else {goto ASK;}

hope this helps

--
to ask a question is a moment of shame
to remain ignorant is a lifelong shame