in reply to Problem with passing my script's STDIN to child
Update: I actually spent some time and came up with a simple example.
For some reason the data isn't pushed through the pipe until you end the input stream (^D) setting $| didn't seem to help.use IO::Pipe; $pipe = new IO::Pipe; if($pid = fork()) { $pipe->writer(); while(<STDIN>) { print $pipe $_; } } else { $pipe->reader(); while(<$pipe>) { $line = $_; print "CHILD: $line"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with passing my script's STDIN to child
by jdalbec (Deacon) on Aug 21, 2004 at 02:11 UTC |