PPIx::Grep - Search PPI documents (not Perl code).
This document describes PPIx::Grep version 0.0.6.
use PPIx::Grep qw< run set_print_format >; set_print_format('%f> %s\n'); # Yes, single quotes. my $return_code = run( qw< include lib/PPIx/Grep.pm > );
This is the guts of ppigrep. You're most likely more interested in that.
Nothing is exported by default, but you can import everything using the
Parse command-line options, find PPI elements, and emit the results.
Returns the expected exit value for the program. This value is equivalent to the one for
grep. If a match was found, this is 0. If no match was found, this is 1. And if any problems occurred, this is 2.
Specifies where the regular output will go.
Specifies where the error output will go.
Sets the pattern that elements will be matched against. This needs to be a compiled regex and not merely a string.
Sets the format to be used to emit an individual PPI::Element. Note that newlines are not automatically printed for each Element; if you want them, you need to specify them as part of the parameter.
The pattern argument could not be resolved to a subclass of
PPI::Element via PPIx::Shorthand.
The pattern argument didn't resolve to any PPI::Element subclasses. Did you specify the empty string?
The regex specified via
--match could not be compiled.
Cannot find the file.
Cannot read the file.
The "file" was actually a directory.
PPI could not interpret the file as a Perl document.
Please report any bugs or feature requests to
firstname.lastname@example.org, or through the web interface at http://rt.cpan.org.
Copyright ©2007-2008, Elliot Shank
<email@example.com>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.