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

Yeah, it was intentional to run the scripts with the do command, are you saying that there may be advantages to running the scripts with a system command instead?
Also, I'm fairly new to perl, so I don't understand what you mean when you say I can dup STDOUT and STDERR

Thanks for your quick response though
Jonathan

Replies are listed 'Best First'.
Re^3: STDOUT and STDIN question
by gaal (Parson) on Nov 03, 2004 at 15:30 UTC
    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.