in reply to Re: forked kid can't read from IO::Select->can_read
in thread forked kid can't read from IO::Select->can_read
for here: perlipc.html#Safe-Pipe-Opens
I took and changed:
So this shouldn't be the problem?$pid = open(KID_TO_WRITE, "|-"); if ($pid) { # parent print KID_TO_WRITE @some_data; close(KID_TO_WRITE) || warn "kid exited $?"; } else { # child while (<STDIN>) { ... print ; # child's STDIN is parent's KID } exit; # don't forget this }
|
|---|