| Pollute documentation | view source | Contained in the Pollute distribution. |
Pollute, Pollute::Persistent - build include files that use modules indirectly
Pollute - Perl extension to re-export imported symbols Pollute::Persistent - Better Perl extension to re-export imported symbols
use Pollute; use This; use That; use TheOther; Pollute; # exports anything imported from This, That or TheOther
or
use Pollute::Persistent; use This; use That; use TheOther; # use of this module exports anything imported from This, That or TheOther
On use, all the symbols in the caller's symbol table are listed into %Pollute::Before, and the Pollute subroutine is exported (through direct symbol table manipulation, not through "Exporter.") After importing various things, run Pollute to export everything you imported since the C<use Pollute> line into the calling package. Pollute::Persistent does the same thing, but using lexicals instead of package variables. Instead of requiring an explicit call to "Pollute" Pollute::Persistent clobbers the import subroutine, meaning that you can create "include file files" by using Pollute::Persistent
the Pollute function, which pollutes its caller
with the symbols which appear in the symbol table but do
not appear in %Before.
Pollute::Persistent clobbers the calling package's import function,
and is suitable for recursive use.
David Nicol, <lt>pollute_author@davidnicol.com<gt>
The name was suggested by Garrett Goebel. I was going to call it "ImportExport."
GPL/Artistic. Enjoy.
| Pollute documentation | view source | Contained in the Pollute distribution. |