1 2
Perl B::Hooks::EndOfScope module allows you to execute code when perl finished compiling the surrounding scope.