.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Pod::Find 3" .TH Pod::Find 3 2024-05-12 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Pod::Find \- find POD documents in directory trees .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& use Pod::Find qw(pod_find simplify_name); \& my %pods = pod_find({ \-verbose => 1, \-inc => 1 }); \& foreach(keys %pods) { \& print "found library POD \`$pods{$_}\*(Aq in $_\en"; \& } \& \& print "podname=",simplify_name(\*(Aqa/b/c/mymodule.pod\*(Aq),"\en"; \& \& $location = pod_where( { \-inc => 1 }, "Pod::Find" ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBNOTE: This module is considered legacy; modern Perl releases (5.31.1 and higher) are going to remove Pod-Parser from core and use Pod::Simple for all things POD.\fR .PP \&\fBPod::Find\fR provides a set of functions to locate POD files. Note that no function is exported by default to avoid pollution of your namespace, so be sure to specify them in the \fBuse\fR statement if you need them: .PP .Vb 1 \& use Pod::Find qw(pod_find); .Ve .PP From this version on the typical SCM (software configuration management) directories are ignored. These are: RCS, CVS, SCCS, .svn, .hg, .git, .sync .ie n .SS """pod_find( { %opts } , @directories )""" .el .SS "\f(CWpod_find( { %opts } , @directories )\fP" .IX Subsection "pod_find( { %opts } , @directories )" The function \fBpod_find\fR 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. .PP E.g. when searching in \fR\f(CI$HOME\fR\fI/perl5lib\fR, the file \&\fI\fR\f(CI$HOME\fR\fI/perl5lib/MyModule.pm\fR would get the POD name \fIMyModule\fR, whereas \fI\fR\f(CI$HOME\fR\fI/perl5lib/Myclass/Subclass.pm\fR would be \&\fIMyclass::Subclass\fR. The name information can be used for POD translators. .PP Only text files containing at least one valid POD command are found. .PP A warning is printed if more than one POD file with the same POD name is found, e.g. \fICPAN.pm\fR in different directories. This usually indicates duplicate occurrences of modules in the \fR\f(CI@INC\fR\fI\fR search path. .PP \&\fBOPTIONS\fR The first argument for \fBpod_find\fR 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. .ie n .IP """\-verbose => 1""" 4 .el .IP "\f(CW\-verbose => 1\fR" 4 .IX Item "-verbose => 1" Print progress information while scanning. .ie n .IP """\-perl => 1""" 4 .el .IP "\f(CW\-perl => 1\fR" 4 .IX Item "-perl => 1" Apply Perl-specific heuristics to find the correct PODs. This includes stripping Perl-like extensions, omitting subdirectories that are numeric but do \fInot\fR match the current Perl interpreter's version id, suppressing \&\fIsite_perl\fR as a module hierarchy name etc. .ie n .IP """\-script => 1""" 4 .el .IP "\f(CW\-script => 1\fR" 4 .IX Item "-script => 1" Search for PODs in the current Perl interpreter's installation \&\fBscriptdir\fR. This is taken from the local Config module. .ie n .IP """\-inc => 1""" 4 .el .IP "\f(CW\-inc => 1\fR" 4 .IX Item "-inc => 1" Search for PODs in the current Perl interpreter's \fR\f(CI@INC\fR\fI\fR paths. This automatically considers paths specified in the \f(CW\*(C`PERL5LIB\*(C'\fR environment as this is included in \fI\fR\f(CI@INC\fR\fI\fR by the Perl interpreter itself. .ie n .SS "simplify_name( $str )" .el .SS "\f(CWsimplify_name( $str )\fP" .IX Subsection "simplify_name( $str )" The function \fBsimplify_name\fR is equivalent to \fBbasename\fR, but also strips Perl-like extensions (.pm, .pl, .pod) and extensions like \&\fI.bat\fR, \fI.cmd\fR on Win32 and OS/2, or \fI.com\fR on VMS, respectively. .ie n .SS """pod_where( { %opts }, $pod )""" .el .SS "\f(CWpod_where( { %opts }, $pod )\fP" .IX Subsection "pod_where( { %opts }, $pod )" Returns the location of a pod document given a search directory and a module (e.g. \f(CW\*(C`File::Find\*(C'\fR) or script (e.g. \f(CW\*(C`perldoc\*(C'\fR) name. .PP Options: .ie n .IP """\-inc => 1""" 4 .el .IP "\f(CW\-inc => 1\fR" 4 .IX Item "-inc => 1" Search \f(CW@INC\fR for the pod and also the \f(CW\*(C`scriptdir\*(C'\fR defined in the Config module. .ie n .IP """\-dirs => [ $dir1, $dir2, ... ]""" 4 .el .IP "\f(CW\-dirs => [ $dir1, $dir2, ... ]\fR" 4 .IX Item "-dirs => [ $dir1, $dir2, ... ]" Reference to an array of search directories. These are searched in order before looking in \f(CW@INC\fR (if \fB\-inc\fR). Current directory is used if none are specified. .ie n .IP """\-verbose => 1""" 4 .el .IP "\f(CW\-verbose => 1\fR" 4 .IX Item "-verbose => 1" List directories as they are searched .PP 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. .PP A subdirectory \fIpod/\fR is also checked if it exists in any of the given search directories. This ensures that e.g. perlfunc is found. .PP 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. .PP A check is made to make sure that the file that is found does contain some pod documentation. .ie n .SS """contains_pod( $file , $verbose )""" .el .SS "\f(CWcontains_pod( $file , $verbose )\fP" .IX Subsection "contains_pod( $file , $verbose )" Returns true if the supplied filename (not POD module) contains some pod information. .SH AUTHOR .IX Header "AUTHOR" Please report bugs using . .PP Marek Rouchal , heavily borrowing code from Nick Ing\-Simmons' PodToHtml. .PP Tim Jenness provided \&\f(CW\*(C`pod_where\*(C'\fR and \f(CW\*(C`contains_pod\*(C'\fR. .PP \&\fBPod::Find\fR is part of the Pod::Parser distribution. .SH "SEE ALSO" .IX Header "SEE ALSO" Pod::Parser, Pod::Checker, perldoc