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