B-CompilerPhase-Hook
view release on metacpan or search on metacpan
lib/B/CompilerPhase/Hook.pm view on Meta::CPAN
enqueue_BEGIN { print " 2. So this line comes out second.\n" }
enqueue_UNITCHECK { print " 3. UNITCHECK blocks run LIFO after each file is compiled.\n" }
enqueue_INIT { print " 9. You'll see the difference right away.\n" }
}
print "13. It only _looks_ like it should be confusing.\n";
# With apologies to the `BEGIN-UNITCHECK-CHECK-INIT-and-END` section of `perlmod`
=head1 DESCRIPTION
This module makes it possible to enqueue callbacks to be run during
the various Perl compiler phases, with the aim of doing multi-phase
meta programming in a reasonably clean way.
=head1 FUNCTIONS
These functions either C<push> or C<unshift> onto the respective internal
arrays for that phase. The distinction is there to preserve the FIFO and
LIFO patterns already inherent in the built-in form of compiler phase
hooks.
lib/B/CompilerPhase/Hook.pm view on Meta::CPAN
what you are doing. For most cases you can just use the C<enqueue>
variants above and all will be well.
=head1 SEE ALSO
=over 4
=item L<Devel::Hook>
This module provides C<push> and C<unshift> access to the internal
arrays that hold the set of compiler phase callbacks. It relies on
you to do the right thing when choosing which of the two actions
(C<push> or C<unshift>) to take.
=back
=head1 AUTHOR
Stevan Little <stevan@cpan.org>
=head1 COPYRIGHT AND LICENSE
( run in 0.290 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )