use autodie::Scope::GuardStack; my $stack = autodie::Scope::GuardStack->new $^H{'my-key'} = $stack; $stack->push_hook(sub {});
Due to how "%^H" works, this class is only useful during the compilation phase of a perl module and relies on the internals of how perl handles references in "%^H". This module is not a part of autodie's public API.
my $stack = autodie::Scope::GuardStack->new;
Creates a new "autodie::Scope::GuardStack". The stack is initially empty and must be inserted into "%^H" by the creator.
push_hook
$stack->push_hook(sub {});
Add a sub to the stack. The sub will be called once the current compile-time ``scope'' is left. Multiple hooks can be added per scope