tie *STDERR, 'My::Tie::Class'; SomeModule::do_something(); untie *STDERR;