This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
util.c:get_db_sub: correct comment
[perl5.git] / dist / Pod-Perldoc / lib / perldoc.pod
CommitLineData
1a67fee7
HS
1
2=head1 NAME
3
4perldoc - Look up Perl documentation in Pod format.
5
6=head1 SYNOPSIS
7
91a46224 8B<perldoc> [B<-h>] [B<-D>] [B<-t>] [B<-u>] [B<-m>] [B<-l>] [B<-F>]
1a67fee7
HS
9[B<-i>] [B<-V>] [B<-T>] [B<-r>]
10[B<-dI<destination_file>>]
11[B<-oI<formatname>>]
12[B<-MI<FormatterClassName>>]
13[B<-wI<formatteroption:value>>]
14[B<-n>I<nroff-replacement>]
15[B<-X>]
faceb03c 16[B<-L> I<language_code>]
a91c97ae 17PageName|ModuleName|ProgramName|URL
1a67fee7
HS
18
19B<perldoc> B<-f> BuiltinFunction
20
faceb03c
ES
21B<perldoc> B<-L> it B<-f> BuiltinFunction
22
1a67fee7
HS
23B<perldoc> B<-q> FAQ Keyword
24
faceb03c
ES
25B<perldoc> B<-L> fr B<-q> FAQ Keyword
26
91a46224
AF
27B<perldoc> B<-v> PerlVariable
28
1a67fee7
HS
29See below for more description of the switches.
30
31=head1 DESCRIPTION
32
33I<perldoc> looks up a piece of documentation in .pod format that is embedded
34in the perl installation tree or in a perl script, and displays it via
35C<pod2man | nroff -man | $PAGER>. (In addition, if running under HP-UX,
36C<col -x> will be used.) This is primarily used for the documentation for
37the perl library modules.
38
39Your system may also have man pages installed for those modules, in
40which case you can probably just use the man(1) command.
41
42If you are looking for a table of contents to the Perl library modules
43documentation, see the L<perltoc> page.
44
45=head1 OPTIONS
46
47=over 5
48
49=item B<-h>
50
51Prints out a brief B<h>elp message.
52
91a46224 53=item B<-D>
1a67fee7 54
91a46224 55B<D>escribes search for the item in B<d>etail.
1a67fee7
HS
56
57=item B<-t>
58
59Display docs using plain B<t>ext converter, instead of nroff. This may be faster,
60but it probably won't look as nice.
61
62=item B<-u>
63
64Skip the real Pod formatting, and just show the raw Pod source (B<U>nformatted)
65
66=item B<-m> I<module>
67
68Display the entire module: both code and unformatted pod documentation.
69This may be useful if the docs don't explain a function in the detail
70you need, and you'd like to inspect the code directly; perldoc will find
71the file for you and simply hand it off for display.
72
73=item B<-l>
74
75Display onB<l>y the file name of the module found.
76
77=item B<-F>
78
79Consider arguments as file names; no search in directories will be performed.
80
81=item B<-f> I<perlfunc>
82
909f2da2 83The B<-f> option followed by the name of a perl built-in function will
1a67fee7
HS
84extract the documentation of this function from L<perlfunc>.
85
86Example:
87
88 perldoc -f sprintf
89
91a46224 90
1a67fee7
HS
91=item B<-q> I<perlfaq-search-regexp>
92
93The B<-q> option takes a regular expression as an argument. It will search
94the B<q>uestion headings in perlfaq[1-9] and print the entries matching
91a46224
AF
95the regular expression.
96
97Example:
98
99 perldoc -q shuffle
100
101
102=item B<-v> I<perlvar>
103
104The B<-v> option followed by the name of a Perl predefined variable will
105extract the documentation of this variable from L<perlvar>.
106
107Examples:
108
109 perldoc -v '$"'
110 perldoc -v @+
111 perldoc -v DATA
112
1a67fee7
HS
113
114=item B<-T>
115
116This specifies that the output is not to be sent to a pager, but is to
117be sent right to STDOUT.
118
119=item B<-d> I<destination-filename>
120
121This specifies that the output is to be sent neither to a pager nor
122to STDOUT, but is to be saved to the specified filename. Example:
123C<perldoc -oLaTeX -dtextwrapdocs.tex Text::Wrap>
124
125=item B<-o> I<output-formatname>
126
127This specifies that you want Perldoc to try using a Pod-formatting
128class for the output format that you specify. For example:
129C<-oman>. This is actually just a wrapper around the C<-M> switch;
130using C<-oI<formatname>> just looks for a loadable class by adding
131that format name (with different capitalizations) to the end of
132different classname prefixes.
133
134For example, C<-oLaTeX> currently tries all of the following classes:
135Pod::Perldoc::ToLaTeX Pod::Perldoc::Tolatex Pod::Perldoc::ToLatex
136Pod::Perldoc::ToLATEX Pod::Simple::LaTeX Pod::Simple::latex
137Pod::Simple::Latex Pod::Simple::LATEX Pod::LaTeX Pod::latex Pod::Latex
138Pod::LATEX.
139
140=item B<-M> I<module-name>
141
142This specifies the module that you want to try using for formatting the
254c2b64 143pod. The class must at least provide a C<parse_from_file> method.
1a67fee7
HS
144For example: C<perldoc -MPod::Perldoc::ToChecker>.
145
146You can specify several classes to try by joining them with commas
147or semicolons, as in C<-MTk::SuperPod;Tk::Pod>.
148
a2afbef4 149=item B<-w> I<option:value> or B<-w> I<option>
1a67fee7
HS
150
151This specifies an option to call the formatter B<w>ith. For example,
152C<-w textsize:15> will call
153C<< $formatter->textsize(15) >> on the formatter object before it is
154used to format the object. For this to be valid, the formatter class
155must provide such a method, and the value you pass should be valid.
156(So if C<textsize> expects an integer, and you do C<-w textsize:big>,
157expect trouble.)
158
159You can use C<-w optionname> (without a value) as shorthand for
160C<-w optionname:I<TRUE>>. This is presumably useful in cases of on/off
161features like: C<-w page_numbering>.
162
909f2da2 163You can use an "=" instead of the ":", as in: C<-w textsize=15>. This
1a67fee7
HS
164might be more (or less) convenient, depending on what shell you use.
165
166=item B<-X>
167
ac036724 168Use an index if it is present. The B<-X> option looks for an entry
1a67fee7
HS
169whose basename matches the name given on the command line in the file
170C<$Config{archlib}/pod.idx>. The F<pod.idx> file should contain fully
171qualified filenames, one per line.
172
faceb03c
ES
173=item B<-L> I<language_code>
174
909f2da2
FC
175This allows one to specify the I<language code> for the desired language
176translation. If the C<POD2::E<lt>language_codeE<gt>> package isn't
a2afbef4 177installed in your system, the switch is ignored.
909f2da2
FC
178All available translation packages are to be found under the C<POD2::>
179namespace. See L<POD2::IT> (or L<POD2::FR>) to see how to create new
180localized C<POD2::*> documentation packages and integrate them into
faceb03c
ES
181L<Pod::Perldoc>.
182
a91c97ae 183=item B<PageName|ModuleName|ProgramName|URL>
1a67fee7
HS
184
185The item you want to look up. Nested modules (such as C<File::Basename>)
a2afbef4 186are specified either as C<File::Basename> or C<< File/Basename >>. You may also
a91c97ae
FC
187give a descriptive name of a page, such as C<perlfunc>. For URLs, HTTP and
188HTTPS are the only kind currently supported.
1a67fee7 189
91a46224
AF
190For simple names like 'foo', when the normal search fails to find
191a matching page, a search with the "perl" prefix is tried as well.
192So "perldoc intro" is enough to find/render "perlintro.pod".
193
1a67fee7
HS
194=item B<-n> I<some-formatter>
195
196Specify replacement for nroff
197
198=item B<-r>
199
200Recursive search.
201
202=item B<-i>
203
204Ignore case.
205
206=item B<-V>
207
208Displays the version of perldoc you're running.
209
210=back
211
212
213
214=head1 SECURITY
215
216Because B<perldoc> does not run properly tainted, and is known to
217have security issues, when run as the superuser it will attempt to
218drop privileges by setting the effective and real IDs to nobody's
219or nouser's account, or -2 if unavailable. If it cannot relinquish
a2afbef4 220its privileges, it will not run.
1a67fee7
HS
221
222
223=head1 ENVIRONMENT
224
225Any switches in the C<PERLDOC> environment variable will be used before the
226command line arguments.
227
228Useful values for C<PERLDOC> include C<-oman>, C<-otext>, C<-otk>, C<-ortf>,
229C<-oxml>, and so on, depending on what modules you have on hand; or
909f2da2 230the formatter class may be specified exactly with C<-MPod::Perldoc::ToMan>
1a67fee7
HS
231or the like.
232
233C<perldoc> also searches directories
234specified by the C<PERL5LIB> (or C<PERLLIB> if C<PERL5LIB> is not
235defined) and C<PATH> environment variables.
236(The latter is so that embedded pods for executables, such as
237C<perldoc> itself, are available.)
238
239C<perldoc> will use, in order of preference, the pager defined in
240C<PERLDOC_PAGER>, C<MANPAGER>, or C<PAGER> before trying to find a pager
241on its own. (C<MANPAGER> is not used if C<perldoc> was told to display
242plain text or unformatted pod.)
243
244One useful value for C<PERLDOC_PAGER> is C<less -+C -E>.
245
246Having PERLDOCDEBUG set to a positive integer will make perldoc emit
ac036724 247even more descriptive output than the C<-v> switch does; the higher the
1a67fee7
HS
248number, the more it emits.
249
91a46224
AF
250
251=head1 CHANGES
252
253Up to 3.14_05, the switch B<-v> was used to produce verbose
254messages of B<perldoc> operation, which is now enabled by B<-D>.
255
373b1311
SP
256=head1 SEE ALSO
257
258L<perlpod>, L<Pod::Perldoc>
91a46224 259
1a67fee7
HS
260=head1 AUTHOR
261
91a46224 262Current maintainer: Adriano R. Ferreira <ferreira@cpan.org>
1a67fee7
HS
263
264Past contributors are:
91a46224 265Sean M. Burke <sburke@cpan.org>,
1a67fee7 266Kenneth Albanowski <kjahds@kjahds.com>,
537c2f98 267Andy Dougherty <doughera@lafcol.lafayette.edu>,
1a67fee7
HS
268and many others.
269
270=cut