in reply to STDOUT and STDIN question

Check out

my $stdout_and_stderr1; my $stdout_and_stderr2; my $stdout_and_stderr3; { print "running script1.pl\n"; local *STDOUT; close(STDOUT); open(STDOUT, '>', \$stdout_and_stderr1) or die("..."); local *STDERR; close(STDERR); open(STDERR, '>&STDOUT') or die("..."); do 'script1.pl'; } { print "running script2.pl\n"; ...

The above requires 5.8(.0? .1?). IO::Scalar can be used with older versions of Perl, but it has limitations.

If you don't mind running the script in a seperate process, I think this works:

$stdout_and_stderr1 = `script1.pl 2>&1`; $stdout_and_stderr2 = `script2.pl 2>&1`; $stdout_and_stderr3 = `script3.pl 2>&1`;

Untested