David Nicol > Pollute-0.07 > Pollute::Persistent

Download:
Pollute-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.07   Source  

NAME ^

Pollute::Persistent - Perl extension to re-export imported symbols

SYNOPSIS ^

  use Pollute::Persistent;
  use This;
  use That;
  use TheOther;
        # exports anything imported from This, That or TheOther

DESCRIPTION ^

  Pollute::Persistent's C<import> function creates a lexical varible
  C<my %before> and puts in it one entry for every entry in the 
  calling package's symbol table.  Then it (over)writes the calling
  package's C<import> function to compare the symbol table as it is
  now to what it was when Pollute::Persistent was initially used and
  makes a list of new items.  Then it rewrites the C<import> function
  again to export the new items, and calls the new, concise import function
  which exports all new items.

  Subsequent uses of the Persistently Polluting module will get the short
  import funtion.

  Pollute::Persistent rewrites its caller's import routine.
  for later use.  Example:

  In one file, called MyFavoriteModules.pm:
  package MyFavoriteModules;
  use Pollute::Persistent;
  use fred;
  use jim;
  use shiela;

  In another file:
  use MyFavoriteModules;        # imports all symbols exported by fred, jim and shiela

  In yet another file:
  use MyFavoriteModules;        # uses newly-defined import function.

EXPORT

Pollute::Persistent clobbers its caller's import routine.

AUTHOR ^

David Nicol, <lt>pollute_author@davidnicol.com<gt>

LICENSE ^

GPL/Artistic. Enjoy.

SEE ALSO ^

perl.

syntax highlighting: