http://qs1969.pair.com?node_id=11121366


in reply to Re: How to capture (intercept) output (warnings) of a module
in thread How to capture (intercept) output (warnings) of a module

But since this is a wrapper around a C lib you might really need to temporarily redirect STDERR and STDOUT to a variable

That would not work unless the C lib performs IO through the PerlIO layer (instead of the usual stdio C layer), something very unlikely.

On the other hand, libtiff provides a TIFFSetWarningHandler function just for customizing error reporting. It is not exposed by the Perl wrapper, but adding that feature shouldn't be too difficult.