Pod::Find(3)
π Pod::Find β find POD documents in directory trees β¨
okay bestie, welcome to Pod::Find(3) π
this little icon lives in the User Contributed Perl Documentation corner of the universe, and she's here to help you hunt down POD files like it's a scavenger hunt in the group chat π
πΈ SYNOPSIS πΈ
use Pod::Find qw(pod_find simplify_name);
my %pods = pod_find({ -verbose => 1, -inc => 1 });
foreach(keys %pods) {
print "found library POD `$pods{$_}' in $_\n";
}
print "podname=",simplify_name('a/b/c/mymodule.pod'),"\n";
$location = pod_where( { -inc => 1 }, "Pod::Find" );
that's the whole vibe right there, no cap π«
π¦ DESCRIPTION π¦
β οΈ NOTE: this module is considered legacy, bestie. modern Perl releases (5.31.1and higher) are literally going to remove Pod-Parser from core and usePod::Simplefor all things POD. so likeβ¦ just know that going in π
Pod::Find provides a set of functions to locate POD files. note that no function is exported by default β that's on purpose, to avoid pollution of your namespace β so be sure to specify them in the use statement if you need them:
use Pod::Find qw(pod_find);
from this version on, the typical SCM (software configuration management) directories are ignored. these are: RCS, CVS, SCCS, .svn, .hg, .git, .sync β yeah we're not digging through those, we have standards π
β¨ pod_find( { %opts } , @directories ) β¨
the function pod_find searches for POD documents in a given set of files and/or directories. it returns a hash with the file names as keys and the POD name as value π«Ά the POD name is derived from the file name and its position in the directory tree.
e.g. when searching in $HOME/perl5lib, the file $HOME/perl5lib/MyModule.pm would get the POD name MyModule, whereas $HOME/perl5lib/Myclass/Subclass.pm would be Myclass::Subclass. the name information can be used for POD translators π
only text files containing at least one valid POD command are found. picky? yes. iconic? also yes π
a warning is printed if more than one POD file with the same POD name is found, e.g. CPAN.pm in different directories. this usually indicates duplicate occurrences of modules in the @INC search path β so like, a vibe check for your install π
πΈ OPTIONS πΈ
the first argument for pod_find may be a hash reference with options. the rest are either directories that are searched recursively or files. the POD names of files are the plain basenames with any Perl-like extension (.pm, .pl, .pod) stripped βοΈ
-verbose => 1β print progress information while scanning. so you can watch her work π-perl => 1β apply Perl-specific heuristics to find the correct PODs. this includes stripping Perl-like extensions, omitting subdirectories that are numeric but do not match the current Perl interpreter's version id, suppressingsite_perlas a module hierarchy name etc. big brain energy fr π§-script => 1β search for PODs in the current Perl interpreter's installationscriptdir. this is taken from the localConfigmodule π-inc => 1β search for PODs in the current Perl interpreter's@INCpaths. this automatically considers paths specified in the"PERL5LIB"environment as this is included in@INCby the Perl interpreter itself β¨
π simplify_name( $str ) π
the function simplify_name is equivalent to basename, but also strips Perl-like extensions (.pm, .pl, .pod) and extensions like .bat, .cmd on Win32 and OS/2, or .com on VMS, respectively π she's flexible like that.
π pod_where( { %opts }, $pod ) π
returns the location of a pod document given a search directory and a module (e.g. "File::Find") or script (e.g. "perldoc") name π₯
options:
-inc => 1β search@INCfor the pod and also the"scriptdir"defined in theConfigmodule.-dirs => [ $dir1, $dir2, ... ]β reference to an array of search directories. these are searched in order before looking in@INC(if-inc). current directory is used if none are specified π-verbose => 1β list directories as they are searched π
returns the full path of the first occurrence to the file. package names (eg 'A::B') are automatically converted to directory names in the selected directory. (eg on unix 'A::B' is converted to 'A/B'). additionally, .pm, .pl and .pod are appended to the search automatically if required π«
a subdirectory pod/ is also checked if it exists in any of the given search directories. this ensures that e.g. perlfunc is found π
it is assumed that if a module name is supplied, that that name matches the file name. pods are not opened to check for the 'NAME' entry β no peeking, we trust the filename π
a check is made to make sure that the file that is found does contain some pod documentation β so no catfishing, the file has to actually have the goods π
π§ contains_pod( $file , $verbose ) π§
returns true if the supplied filename (not POD module) contains some pod information β simple as that, she just tells you yes or no.
π AUTHOR π
please report bugs using <http://rt.cpan.org> π«Ά
Marek Rouchal <marekr@cpan.org>, heavily borrowing code from Nick Ing-Simmons' PodToHtml.
Tim Jenness <t.jenness@jach.hawaii.edu> provided "pod_where" and "contains_pod" π
Pod::Find is part of the Pod::Parser distribution.
π SEE ALSO π
Pod::Parser, Pod::Checker, perldoc
and that's the whole page, bestie π₯Ήπ this was Pod::Find(3) from the User Contributed Perl Documentation, shipping with perl v5.40.0 on 2024-10-29 β go find some PODs, slay, periodt β¨π¦π
π¦ where this page comes from
- centos-stream 10: perl-Pod-Parser 1.67-5.el10 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms