The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::File::Grepper - Greps files for pattern

SYNOPSIS

Runs a File::Find on the specified directories, and greps all text files for a pattern.

use App::File::Grepper;
App::File::Grepper->main( $options, @dirs );

RATIONALE

There are many tools that can do this, e.g. ack. However none of these can call an editor when a file matches the search argument and that is something I often need.

OPTIONS

The first argument to the main() method is a reference to a hash with options.

pattern

The pattern to grep. If it starts with a slash it is interpreted as a perl pattern. Otherwise it is assumed to be a literal text to grep for.

If the text does not contain any uppercase letters, matching will be done case-insensitive unless overridden by option ignorecase.

ignorecase

If defined, matching will be case-insensitive according to the value of ignorecase.

edit-with-emacs

Pass each file where the pattern is found to the emacs editor client.

edit-with-vi

Pass each file where the pattern is found to the vi editor.

view

Pass each file where the pattern is found to the less viewer.

filter

A perl pattern to select which files must be processed. Note that this pattern is applied to the basename of each file, not the full path.

exclude

A perl pattern to select which files must be rejected. Note that this pattern is applied to the basename of each file, not the full path. Also, this pattern is applied before the filter pattern.

Version control directories RCS, CVS, .svn, .git and .hg are always excluded, as are common editor backups.

AUTHOR

Johan Vromans, <jv at cpan.org>

BUGS

Please report any bugs or feature requests to bug-app-file-grepper at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-File-Grepper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Development of this module takes place on GitHub: https://github.com/sciurius/afg.

You can find documentation for this module with the perldoc command.

perldoc App::Packager

Please report any bugs or feature requests using the issue tracker on GitHub.

ACKNOWLEDGEMENTS

This program was inspired by ack not having a -e option.

COPYRIGHT & LICENSE

Copyright 2012,2016,2022 Johan Vromans, all rights reserved.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 237:

=back without =over