title: Why can't my Java program read Perl's STDERR?
body: <p>We have a Perl program to validate XML which is invoked from a Java program. It is not able to write to standard error and hanging in the print location. </p>
  
  <p>Perl is writing to STDERR and a java program is reading the STDERR using getErrorStream() function. But the Perl program is hanging to write to STDERR. I suspect Java function is blocking the STDERR stream completely and Perl is waiting for this stream to be released. </p>
  
  <p>Is there a way in Perl to overcome this blockage and write to standard error forcefully? Since Java is doing only a read the API should not be locking the STDERR stream as per java doc.</p>
  
  <p>Perl Code snippet is:</p>
  
  <pre><code>sub print_error
  {
      print STDERR shift;
  }
  </code></pre>
  
  <p>Java code snippet is:</p>
  
  <pre><code>while ( getErrorStream() != null )
  {
      SOP errorMessage;
  }
  </code></pre>
  
  <p>Appreciate the help in advance.</p>
  
  <p>Thanks,
  Mathew Liju</p>