in reply to Re^2: Nested redirect for STDERR to a string buffer within a perl program
in thread Nested redirect for STDERR to a string buffer within a perl program
IIRC Capture::Tiny uses a real temp file, so the file handle is redirected even if you fork or exec. If that's something you want to capture, then you need that method. The 'local' to a scalar will only apply to perl code within the same process, but it will also be more efficient because an OS file handle isn't involved.