title: How do I allow two concurrent processes to communicate?
body: <p>I have two separate processes: a C program that outputs comma separated values followed by a newline every second, and a Perl program that accepts data (in the same format) and processes this data.</p>
  
  <p>The C program outputs (via printf) values as such:  </p>
  
  <pre><code>1, 2, 3, 4, 5, 6  
  7, 8, 9, 10, 11, 12  
  ...
  </code></pre>
  
  <p>The Perl program sits in an infinite loop waiting on a line basis for STDIN in order to process this data:  </p>
  
  <pre><code>while ($line = &lt;STDIN&gt;)
  {
      chomp($line) # Line should now read "1,2,3,4,5,6"
      # Process data
  }
  </code></pre>
  
  <p>I want these two processes to communicate in real time.  Standard bash pipes do not work (e.g. process1 | process2) because the Perl program waits for the first program to finish before processing the input.  </p>
  
  <p>Does anyone have any ideas, suggestions, or insightd as to a solution to this problem?  Thank you in advance!</p>