in reply to interprocess communication

Please don't erase and replace your answered questions. Someone else might have the same issue. You've ruined search and threading. Below is something akin to the original.

I'm trying to figure out how to pass data from one process to another. I've read perlipc but I am still missing something or misunderstood something. Would any one be able to set me straight on what I'm doing wrong?

 #!/usr/bin/perl pipe(READER, WRITE); $pid =fork(); if ($pid) { print "\nIn parent"; $val1 = 100; while($num = <READER>) { print "\nin while"; print $num; } close(READER); } else { print "\nIn child"; $val2 = 150; print WRITE $val2; close(WRITE); print "\nChild closed write"; } do { $forkvar = waitpid (-1, WNOHANG); } while ($forkvar < 0);

Replies are listed 'Best First'.
Re^2: interprocess communication
by Anonymous Monk on May 15, 2014 at 20:03 UTC
    Yes, please put the original question text back into your post, then add the fact that you solved it after that, perhaps with a brief summary.