NAME
Acme::CPANModules::GrepVariants - Grep-like CLI utilities available on CPAN
VERSION
This document describes version 0.001 of Acme::CPANModules::GrepVariants (from Perl distribution Acme-CPANModules-GrepVariants), released on 2020-04-16.
DESCRIPTION
Grep-like CLI utilities available on CPAN.
Improvements
Created in 2005 by Andy Lester, ack is the granddaddy of grep-like programs that try to improve the experience of using grep to search for text in source code. ack skips VCS directories like .git
or .svn
, and understands file types so it doesn't look into giant .mp4
s and other binaries by default. ack has spurred the development of other ack improvements (mostly in speed aspect) like The Silver Searcher (ag
) or ripgrep
. git
also now includes a git-grep
utility. ack has a website: https://beyondgrep.com. See also https://betterthanack.com.
App::Greple and App::abgrep try to make searching for multiple patterns in grep easier. To search for all 'foo' and 'bar' in grep in no particular order, you either have to do something like:
% grep --color=always foo FILES | grep bar
or:
% grep -P 'foo.*bar|bar.*foo' FILES
both of which get unwieldy if the number of patterns get higher. Or you can use look-ahead:
% grep -P '(?=.*foo)(?=.*bar)' FILES
but this does not capture (thus highlight) the patterns.
Note that searching for multiple patterns in particular order ('foo.*bar'), or searching for aternates from multiple patterns ('foo|bar') is no problem in grep.
greple also has a few other tricks up its sleeve, like configuration file to define complex regexes, matching across lines, and Japanese text support.
Instead of specifying a pattern, with App::rpgrep you can specify a pattern name in a Regexp::Pattern::* module instead.
Reimplementations
grep for PerlPowerTools simply tries to reimplement grep in Perl, as part of the project to reimplement many Unix utilities in Perl. It has few practical uses.
Searching Perl source code
App::pmgrep lets you grep over locally installed Perl modules. It's basically a shortcut for something like this:
% pmlist -Rx | grep PAT
% grep PAT C<pmlist -Rx>
App::Grepl uses PPI to let you grep over Perl documents; it allows you to do things like: search only in Perl code comments or inside string literals.
*Searching other than files: *
TODO
INCLUDED MODULES
FAQ
What are ways to use this module?
Aside from reading it, you can install all the listed modules using cpanmodules:
% cpanmodules ls-entries GrepVariants | cpanm -n
or Acme::CM::Get:
% perl -MAcme::CM::Get=GrepVariants -E'say $_->{module} for @{ $LIST->{entries} }' | cpanm -n
This module also helps lcpan produce a more meaningful result for lcpan related-mods
when it comes to finding related modules for the modules listed in this Acme::CPANModules module.
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Acme-CPANModules-GrepVariants.
SOURCE
Source repository is at https://github.com/perlancar/perl-Acme-CPANModules-GrepVariants.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANModules-GrepVariants
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
Acme::CPANModules - about the Acme::CPANModules namespace
cpanmodules - CLI tool to let you browse/view the lists
Acme::CPANModules::GoodInterfaces
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.