podgrep1p
Grep in pod sections only
Usage
podgrep [-i]
[-p]
[-f]
[-h]
pattern
[files ...]
Overview
This program searches each paragraph in a pod document and prints each paragraph that matches the supplied pattern. This pod may be mixed with program code, such as in a module.
Options are:
-
-i -
means case insensitive match
-
-p -
means page output though the user's pager. The pager will be primed with an argument to search for the string. This highlights the result.
-
-f -
means format output though the pod2text program.
-
-h -
means check for matches in pod
"=head"and"=item"headers alone, and to keep printing podagraphs until the next header is found.
Examples
$ podgrep mail `pmpath CGI`(prints out podagraphs from the CGI.pm manpage that mention mail)$ podgrep -i destructor `sitepods`(prints out podagraphs that mention destructors in thesite-installed pods)$ podgrep -i 'type.?glob' `stdpods`(prints out podagraphs that mention typeglob in thestandard pods)$ podgrep -hpfi "lock" `faqpods`(prints out all podagraphs with "lock" in the headerscase-insensitively, then formats these with pod2text, thenshows them in the pager with matches high-lighted)$ podgrep -fh seek `podpath perlfunc`(prints out and formats podagraphs from the standard perlfunc manpagewhose headers or items contain "seek".)
Note
For a pager, the author likes these environment settings (in the login startup, of course):
$ENV{PAGER} = "less";$ENV{LESS} = "MQeicsnf";
AUTHORS and COPYRIGHTS
Copyright (C) 1999 Tom Christiansen.
Copyright (C) 2006-2014, 2018 Mark Leighton Fisher.
Releases
13 releases since Debian 2.2 (Potato); the text changed 7 times.