in reply to Fork/Spawn

No, don't just append to a string - you need one of the ways listed above (pipe, server/client) Appending to a string gets very messy quickly. The solution to your problem really depends on how many children you are trying to fork, and how much work each must do. You may not even need to fork at all. The overhead of all the forking, piping, etc. may not be worth the trouble. Try timing the different ways: flat (no children), forked with temp files and few children, piped with many children, etc. Ideally, you want to balance out the work performed by each children, and find the best number of children for the fastest overall result. Also keep an eye on the number of children: if this process (i.e. a search engine for a site) is called many times by different people, thousands of children are not a good idea :)