NAME PPI::Processor - Implement a PPI Document processing engine DESCRIPTION PPI::Processir provides a base class for implementing PPI-based Perl Document Proccessing Engine. This base class both provides a standard interface, and implements a complete single-node engine. By extending this class, it is intended to later implement a SMP, cluster, and/or distributed parrelel processing engine as well, using the same basic API. METHODS new source => $source The "new" constructor creates a new Processor object. It takes as argument a set of name => value pairs. The base class accepts two named parameters. source The required "source" param identifies the source directory for the perl files to be processed. It must be a directory that exists and for which we have read permissions. find The optional "find" parameter lets you pass a File::Find::Rule object that will be used to find the set of files within the source directory that are to be processed. If not provided, a default File::Find::Rule object will be used that processes all .pm files contained in the source directory. Returns a new PPI::Processor object, or "undef" on error. source The "source" accessor method returns the source directory that the object was created with. add_task $Task The "add_task" method is used to add a Task to the Processor object before processing commences. The parameter should be either an instantiated PPI::Processor::Task object, or the same of a sub-class which is autoconstructable. If passed a class name, the class will be loaded, the "autoconstruct" method will be checked, and an object will be created if the Task class supports autoconstruct. While adding the Task object, the Processor will also initialize the state hash for the Task. Returns true if the Task is added, or "undef" on error. run The "run" method starts the main processor loop. It takes no arguments, and the function will continue to load and process documents until it has completed all matching documents within the document source. Returns the total number of matching files, regardless of whether or not they were skipped or actually processed by the various Tasks. Returns "undef" if a fatal processing error occured during the run. init Given the size and complexity of many document processing tasks, the "init" provides a convenient mechanism to prepare various things for the main processing loop. By default, this includes determining and storing the full list of files to be processed, setting some state flags, and other tasks. Returns true on success, or "undef" on error. SUPPORT Bugs should always be submitted via the CPAN bug tracker For other issues, contact the maintainer AUTHOR Adam Kennedy (Maintainer), , cpan@ali.as Funding provided by The Perl Foundation COPYRIGHT Copyright (c) 2004 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO PPI::Processor::Task, PPI