We have a Perl program for validating XML, which is called from a Java program. He cannot write a standard error and hangs at the print location.
Perl writes to STDERR, and the java program reads STDERR using the getErrorStream () function. But the Perl program is hung to write to STDERR. I suspect that the Java function completely blocks the STDERR thread, and Perl waits for this thread to be released.
Is there any way in Perl to overcome this lock and write a standard error strongly? Since Java does read-only, the API should not block the STDERR stream according to java doc.
Perl code snippet:
sub print_error
{
print STDERR shift;
}
Java code snippet:
while ( getErrorStream() != null )
{
SOP errorMessage;
}
Appreciate the help in advance.
Thanks Matthew Liju