NAME

Filter::PPI - PPI based source filtering

SYNOPSIS

package MyFilter;

use Filter::PPI;

sub ppi_filter {
  my ($class,$doc) = @_;

  # Do funny things to $doc here

  return $doc;
}

package MyModule;

use MyFilter;

# This will get filtered

DESCRIPTION

This module lets you write perl source filters using PPI to process the source. Compared to other modules used for writing source filters, it is quite simple. You only need to have one method in your class, called ppi_filter. This gets passed the class name, a PPI::Document object, and any arguments given to import. The method is expected to return a PPI::Document but not neccesarily the same one. The document returned will be what's used by perl to compile the program.

SEE ALSO

Filter::Util::Call
PPI

BUGS

Most software has bugs. This module probably isn't an exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Anders Nor Berle <berle@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2008 by Anders Nor Berle.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.