App::File::Grepper - Greps files for pattern
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 );
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.
The first argument to the main() method is a reference to a hash with options.
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.
If defined, matching will be case-insensitive according to the value of ignorecase.
Pass each file where the pattern is found to the emacs editor client.
Pass each file where the pattern is found to the vi editor.
Pass each file where the pattern is found to the less viewer.
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.
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
.hg are always excluded.
<jv at cpan.org>
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.
You can find documentation for this module with the perldoc command.
You can also look for information at:
This program was inspired by
ack not having a -e option.
Copyright 2012 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.