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 :all tag.
:all
run(@ARGV)
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.
grep
set_stdout($destination)
Specifies where the regular output will go.
set_stderr($destination)
Specifies where the error output will go.
set_match($regex)
Sets the pattern that elements will be matched against. This needs to be a compiled regex and not merely a string.
set_print_format($format)
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.
PPI::Element
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.
--match
Cannot find the file.
Cannot read the file.
The "file" was actually a directory.
PPI could not interpret the file as a Perl document.
None, currently.
Getopt::Long List::MoreUtils PPI::Document PPIx::Shorthand String::Format
None reported.
Please report any bugs or feature requests to bug-ppix-grep@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-ppix-grep@rt.cpan.org
App::Ack App::Grepl
Elliot Shank <perl@galumph.com>
<perl@galumph.com>
Copyright ©2007-2008, Elliot Shank <perl@galumph.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.
To install PPIx::Grep, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPIx::Grep
CPAN shell
perl -MCPAN -e shell install PPIx::Grep
For more information on module installation, please visit the detailed CPAN module installation guide.