Filter::EOFRun a callback after a file has been compiled | |
Download |
Filter::EOF Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Robert Sedlacek
- Publisher web site:
- http://search.cpan.org/~phaylon/
Filter::EOF Tags
Filter::EOF Description
Run a callback after a file has been compiled Filter::EOF is a Perl module that utilises Perl's source filters to provide you with a mechanism to run some code after a file using your module has been processed.SYNOPSIS package MyPackage; use warnings; use strict; use Filter::EOF; sub import { my ($class, @args) = @_; my $caller = scalar caller; # set the COMPILE_TIME package var to a false value # when the file was compiled Filter::EOF->on_eof_call(sub { no strict 'refs'; ${ $caller . '::COMPILE_TIME' } = 0; }); # set the COMPILE_TIME package var to a true value when # we start compiling it. { no strict 'refs'; ${ $caller . '::COMPILE_TIME' } = 1; } } 1; ... package MyUsingPackage; use warnings; use strict; our $COMPILE_TIME; use MyPackage; # prints 'yes' BEGIN { print +( $COMPILE_TIME ? 'yes' : 'no' ), " " } # prints 'no' print +( $COMPILE_TIME ? 'yes' : 'no' ), " "; 1; Requirements: · Perl
Filter::EOF Related Software