I submit the following question for your ponderance. I have written a perl script for work that exploits the naming conventions of sql files to determine on what server they have to run, and on what database they have to be executed on. I've run in to the problem where if a developer has many large files to run, then they can take a very long time, especially with endsite servers in Manila, Sydney, Madrid, etc... What I want to do is fork off a child for each server that has to be hit. My problem lies in the fact that the tool also logs its results to either a file or to STDOUT (users choice). How do I have it so that children don't "clobber" eachother trying to write to the same filehandle? I have a feeling that this has to do with
, but don't know where to begin.