We may be able to help... if you show us your ( SSCCE ) code.
In reply to Re: Unable to flush stdout: Invalid argument by ww in thread Unable to flush stdout: Invalid argument by bakiperl