Tried a simple work around with threads. Still does not work, and filehandles cannot be shared.