4 perldoc - Look up Perl documentation in Pod format.
8 perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-F]
12 [-M FormatterClassName]
13 [-w formatteroption:value]
14 [-n nroff-replacement]
17 PageName|ModuleName|ProgramName|URL
21 perldoc -f BuiltinFunction
23 perldoc -L it -f BuiltinFunction
25 perldoc -q FAQ Keyword
27 perldoc -L fr -q FAQ Keyword
29 perldoc -v PerlVariable
33 See below for more description of the switches.
37 B<perldoc> looks up a piece of documentation in .pod format that is
38 embedded in the perl installation tree or in a perl script, and displays
39 it via C<groff -man | $PAGER>. (In addition, if running under HP-UX,
40 C<col -x> will be used.) This is primarily used for the documentation for
41 the perl library modules.
43 Your system may also have man pages installed for those modules, in
44 which case you can probably just use the man(1) command.
46 If you are looking for a table of contents to the Perl library modules
47 documentation, see the L<perltoc> page.
55 Prints out a brief B<h>elp message.
59 B<D>escribes search for the item in B<d>etail.
63 Display docs using plain B<t>ext converter, instead of nroff. This may be faster,
64 but it probably won't look as nice.
68 Skip the real Pod formatting, and just show the raw Pod source (B<U>nformatted)
72 Display the entire module: both code and unformatted pod documentation.
73 This may be useful if the docs don't explain a function in the detail
74 you need, and you'd like to inspect the code directly; perldoc will find
75 the file for you and simply hand it off for display.
79 Display onB<l>y the file name of the module found.
83 Consider arguments as file names; no search in directories will be performed.
85 =item B<-f> I<perlfunc>
87 The B<-f> option followed by the name of a perl built-in function will
88 extract the documentation of this function from L<perlfunc>.
95 =item B<-q> I<perlfaq-search-regexp>
97 The B<-q> option takes a regular expression as an argument. It will search
98 the B<q>uestion headings in perlfaq[1-9] and print the entries matching
99 the regular expression.
105 =item B<-a> I<perlapifunc>
107 The B<-a> option followed by the name of a perl api function will
108 extract the documentation of this function from L<perlapi>.
114 =item B<-v> I<perlvar>
116 The B<-v> option followed by the name of a Perl predefined variable will
117 extract the documentation of this variable from L<perlvar>.
128 This specifies that the output is not to be sent to a pager, but is to
129 be sent directly to STDOUT.
131 =item B<-d> I<destination-filename>
133 This specifies that the output is to be sent neither to a pager nor
134 to STDOUT, but is to be saved to the specified filename. Example:
135 C<perldoc -oLaTeX -dtextwrapdocs.tex Text::Wrap>
137 =item B<-o> I<output-formatname>
139 This specifies that you want Perldoc to try using a Pod-formatting
140 class for the output format that you specify. For example:
141 C<-oman>. This is actually just a wrapper around the C<-M> switch;
142 using C<-oI<formatname>> just looks for a loadable class by adding
143 that format name (with different capitalizations) to the end of
144 different classname prefixes.
146 For example, C<-oLaTeX> currently tries all of the following classes:
147 Pod::Perldoc::ToLaTeX Pod::Perldoc::Tolatex Pod::Perldoc::ToLatex
148 Pod::Perldoc::ToLATEX Pod::Simple::LaTeX Pod::Simple::latex
149 Pod::Simple::Latex Pod::Simple::LATEX Pod::LaTeX Pod::latex Pod::Latex
152 =item B<-M> I<module-name>
154 This specifies the module that you want to try using for formatting the
155 pod. The class must at least provide a C<parse_from_file> method.
156 For example: C<perldoc -MPod::Perldoc::ToChecker>.
158 You can specify several classes to try by joining them with commas
159 or semicolons, as in C<-MTk::SuperPod;Tk::Pod>.
161 =item B<-w> I<option:value> or B<-w> I<option>
163 This specifies an option to call the formatter B<w>ith. For example,
164 C<-w textsize:15> will call
165 C<< $formatter->textsize(15) >> on the formatter object before it is
166 used to format the object. For this to be valid, the formatter class
167 must provide such a method, and the value you pass should be valid.
168 (So if C<textsize> expects an integer, and you do C<-w textsize:big>,
171 You can use C<-w optionname> (without a value) as shorthand for
172 C<-w optionname:I<TRUE>>. This is presumably useful in cases of on/off
173 features like: C<-w page_numbering>.
175 You can use an "=" instead of the ":", as in: C<-w textsize=15>. This
176 might be more (or less) convenient, depending on what shell you use.
180 Use an index if it is present. The B<-X> option looks for an entry
181 whose basename matches the name given on the command line in the file
182 C<$Config{archlib}/pod.idx>. The F<pod.idx> file should contain fully
183 qualified filenames, one per line.
185 =item B<-L> I<language_code>
187 This allows one to specify the I<language code> for the desired language
188 translation. If the C<POD2::E<lt>language_codeE<gt>> package isn't
189 installed in your system, the switch is ignored.
190 All available translation packages are to be found under the C<POD2::>
191 namespace. See L<POD2::IT> (or L<POD2::FR>) to see how to create new
192 localized C<POD2::*> documentation packages and integrate them into
195 =item B<PageName|ModuleName|ProgramName|URL>
197 The item you want to look up. Nested modules (such as C<File::Basename>)
198 are specified either as C<File::Basename> or C<< File/Basename >>. You may also
199 give a descriptive name of a page, such as C<perlfunc>. For URLs, HTTP and
200 HTTPS are the only kind currently supported.
202 For simple names like 'foo', when the normal search fails to find
203 a matching page, a search with the "perl" prefix is tried as well.
204 So "perldoc intro" is enough to find/render "perlintro.pod".
206 =item B<-n> I<some-formatter>
208 Specify replacement for groff
220 Displays the version of perldoc you're running.
226 Because B<perldoc> does not run properly tainted, and is known to
227 have security issues, when run as the superuser it will attempt to
228 drop privileges by setting the effective and real IDs to nobody's
229 or nouser's account, or -2 if unavailable. If it cannot relinquish
230 its privileges, it will not run.
234 Any switches in the C<PERLDOC> environment variable will be used before the
235 command line arguments.
237 Useful values for C<PERLDOC> include C<-oterm>, C<-otext>, C<-ortf>,
238 C<-oxml>, and so on, depending on what modules you have on hand; or
239 the formatter class may be specified exactly with C<-MPod::Perldoc::ToTerm>
242 C<perldoc> also searches directories
243 specified by the C<PERL5LIB> (or C<PERLLIB> if C<PERL5LIB> is not
244 defined) and C<PATH> environment variables.
245 (The latter is so that embedded pods for executables, such as
246 C<perldoc> itself, are available.)
248 In directories where either C<Makefile.PL> or C<Build.PL> exist, C<perldoc>
249 will add C<.> and C<lib> first to its search path, and as long as you're not
250 the superuser will add C<blib> too. This is really helpful if you're working
251 inside of a build directory and want to read through the docs even if you
252 have a version of a module previously installed.
254 C<perldoc> will use, in order of preference, the pager defined in
255 C<PERLDOC_PAGER>, C<MANPAGER>, or C<PAGER> before trying to find a pager
256 on its own. (C<MANPAGER> is not used if C<perldoc> was told to display
257 plain text or unformatted pod.)
259 When using perldoc in it's C<-m> mode (display module source code),
260 C<perldoc> will attempt to use the pager set in C<PERLDOC_SRC_PAGER>.
261 A useful setting for this command is your favorite editor as in
262 C</usr/bin/nano>. (Don't judge me.)
264 One useful value for C<PERLDOC_PAGER> is C<less -+C -E>.
266 Having PERLDOCDEBUG set to a positive integer will make perldoc emit
267 even more descriptive output than the C<-D> switch does; the higher the
268 number, the more it emits.
273 Up to 3.14_05, the switch B<-v> was used to produce verbose
274 messages of B<perldoc> operation, which is now enabled by B<-D>.
278 L<perlpod>, L<Pod::Perldoc>
282 Current maintainer: Mark Allen C<< <mallen@cpan.org> >>
284 Past contributors are:
285 brian d foy C<< <bdfoy@cpan.org> >>
286 Adriano R. Ferreira C<< <ferreira@cpan.org> >>,
287 Sean M. Burke C<< <sburke@cpan.org> >>,
288 Kenneth Albanowski C<< <kjahds@kjahds.com> >>,
289 Andy Dougherty C<< <doughera@lafcol.lafayette.edu> >>,