use IPC::Open3; my $script = shift; $|++; eval {open3(undef, \*OUT, \*ERR, "./$script @ARGV") }; wait(); my $status = $? >> 8; print "Now executing $script @ARGV"; print "STDOUT:"; print while ; print "STERR:"; print while ; print "$script finished with status = $status"; close OUT;