thanks, that explains a lot. Actually the child threads are detached, but I'll handle that.
in some archives at perlmonks someone said that file descriptors are global across all threads, and that's what confused me in my understanding of what's going on. Also it looks like when the thread is created, it does not inherit the value of $| - the messages written by the child thread are sometimes cut by the buffering.
I think the most reliable thing would be instead of printing to STDERR in the child thread, push the error messages into a queue and let the main thread pop the messages and print them to the main thread's STDERR.