in reply to Let a module call a sub of the caller
B::Hooks::EndOfScope or perhaps Hook::AfterRuntime (or even a combination of the two) ought to do the trick.