in reply to Pipes (for interprocess communication)
pipe(my $reader, my $writer); # Create a pipe if (my $pid = fork()) { # In parent: read one line from the pipe and print it print "Message from child: ".<$reader>; } else { # In child: print a line of text to the pipe print $writer ("Hello, parent!\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pipes (for interprocess communication)
by penguin_asylum (Sexton) on Dec 09, 2005 at 19:36 UTC | |
by Celada (Monk) on Dec 09, 2005 at 21:06 UTC | |
|
Re^2: Pipes (for interprocess communication)
by penguin_asylum (Sexton) on Dec 09, 2005 at 18:46 UTC | |
by robin (Chaplain) on Dec 09, 2005 at 18:54 UTC |