autodie::ScopeUtil (3)
Leading comments
Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) Standard preamble: ========================================================================
NAME
autodie::ScopeUtil - Utilities for managing %^H scopesSYNOPSIS
use autodie::ScopeUtil qw(on_end_of_compile_scope); on_end_of_compile_scope(sub { print "Hallo world\n"; });
DESCRIPTION
Utilities for abstracting away the underlying magic of (ab)using "%^H" to call subs at the end of a (compile-time) scopes.Due to how "%^H" works, these utilities are 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.
Methods
on_end_of_compile_scope
on_end_of_compile_scope(sub { print "Hallo world\n"; });
Will invoke a sub at the end of a (compile-time) scope. The sub is called once with no arguments. Can be called multiple times (even in the same ``compile-time'' scope) to install multiple subs. Subs are called in a ``first-in-last-out''-order (
FILO
or ``stack''-order).