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