in reply to
Catching STDIN and STDERR on the fly
IO::NestedCapture
looks flexible enough for your needs.
Comment on
Re: Catching STDIN and STDERR on the fly
In Section
Seekers of Perl Wisdom