http://qs1969.pair.com?node_id=515616


in reply to Pipes (for interprocess communication)

Here is a simple example:
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"); }