title: IPC::Open2 middleware
body: <p>I would like to make a wrapper that would take data from STDIN and pass it to another script, wait for his STDOUT response and output it to STDOUT on the parent side.</p>
  
  <p>I have the following code but it does not seems to work:</p>
  
  <pre><code>test.pl
  #!/usr/bin/perl
  #
  use IPC::Open2;
  $pid = open2( \*RDR, \*WTR, '/usr/bin/perl test2.pl');
  
  while (&lt;STDIN&gt;) {
       print WTR; 
  }
  
  while (&lt;RDR&gt;) {
       print STDOUT;
  }
  </code></pre>
  
  <p>and on the test2.pl, i have:</p>
  
  <pre><code>#!/usr/bin/perl
  #
  
  while (&lt;STDIN&gt;) {
       print STDOUT;
  }
  </code></pre>
  
  <p>It seems to write to test2.pl but i have no feedback from test2.pl.</p>
  
  <p>Any hints?</p>
  
  <p>Thank's,</p>