in reply to Catch messages to STDERR
See Catching fork() with tied STDERR for one possible approach to this, and some discussion of the problems you might face if you take this approach. For your example you'd need to change the PRINT function in my tie class to something like:
sub PRINT { my $self = shift; # the tied STDERR object errhandler(@_); }
You could then wrap the call to the external function something like:
tie *STDERR, 'My::Tie::Class'; SomeModule::do_something(); untie *STDERR;
Hugo
|
|---|