in reply to IPC::Open3 STDOUT does not EOF?

I tried to replicate the problem but couldn't get it to hang. Here's the code that I tried.
#!/usr/bin/perl use strict; use warnings; use IPC::Open3; my $conf; my @args; local(*HIS_IN, *HIS_OUT, *HIS_ERR); my $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, $conf, @args); close HIS_IN; my(@outlines) = <HIS_OUT>; waitpid($childpid, 0); if ($?) { print "Status is: $?\n"; }

Replies are listed 'Best First'.
Re^2: IPC::Open3 STDOUT does not EOF?
by ikegami (Patriarch) on Jul 11, 2010 at 23:59 UTC
    You didn't specify which command you used. Try
    #!/usr/bin/perl use strict; use warnings; use IPC::Open3; my @cmd = ( perl => (-e => 'print STDERR "x"x1024 for 1..100') ); local(*HIS_IN, *HIS_OUT, *HIS_ERR); my $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, @cmd); close HIS_IN; my(@outlines) = <HIS_OUT>; waitpid($childpid, 0); if ($?) { printf "Status is: %04X\n", $?; }

    On linux, readline never returns.

      You're right. I tried it, and readline never returned. Thanks.