in reply to Re^2: STDOUT and STDIN question
in thread STDOUT and STDIN question

Yes, do is a bit less useful than two different appoaches: modules, and completely separate scripts.

If your child scripts have any code in common with each other, and especially if they can share resources (files, data), it makes sense to write a module for each, and let everything run in equal standing in the same process. If, however, you want each task to really be a separate script, don't risk lefover values leaking over, and have the master invoke each script in a completely separate process.

(You can still share code by using modules if you run separate processes, of course: simply have them use the common code.)

As for duping, you can copy -- dup -- a filehandle over. perlopentut has details. It doesn't finish solving your original problem but it might help; alternatively pg's suggestion might be a better route.