Once again I find myself in a hotspot where none other than the infinitely wise Monks could offer solace...
I have a number of objects, each of which has a filehandle running in its own little separate thread. Each of those filehandles reads in data and then calls on a coderef with that data as an argument for further processing. The problem I am faced with is that due to the coderef being called from within the thread, the sub that is called on feels the other objects do not exist. So what I'm looking for is some sort of method of safely transporting the data read in from the filehandles from the individual threads to the main thread, so as to be processed in a location where all the objects actually live, allowing me to call on other objects from within the subroutine called. I've tried to use a shared array, where lines of data would be pushed on from within the separate threads, and then be shifted out in the main thread, but that wasn't really a big success.
Any ideas, suggestions, etc?
Many thanks in advance.