Win32::Socketpair did the trick. Apparently pipes aren't handled well when redirecting STDIO.
The module does exactly the same thing to redirect the STDIN/STDOUT that I tried without success. The big difference was that it was using a network socket instead of a pipe.
For the record, I did have to set the handles to autoflush in both the client and server code in order for things to work properly.
Thanks for your help.
# In the server: use IO::Handle; my @command = ( 'perl', 'client.pl' ); my ($started, $fd)= winopen2( @command ); $fd->autoflush; # and the client: use IO::Handle; STDIN->autoflush; STDOUT->autoflush; print "$_" while <>;
TGI says moo
In reply to Re^4: Win32 Perl: inheriting redirected STDIN and STDOUT in a child process (select)
by TGI
in thread Win32 Perl: inheriting redirected STDIN and STDOUT in a child process
by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |