i would like to know how could i open and close this file in one thread and it will affect all the other threads that are writing to this file handle.
That is exactly what my posted code showed you how to do. If all your threads are using a well-known handle (like STDERR) for logging, then all you need to do is re-open that to the new file and all the other threads will be redirected to that new file. (You should also use some locking for safety!)
If you are using some kind of object-based wrapper or (dratted) singleton instance to obtain or supply the handle, then you will have to post a (small) working snippet that demonstrates what you are doing. We can then look at what needs to be done to make that work for you.
In reply to Re^3: perl file handle share thread
by BrowserUk
in thread perl file handle share thread
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |