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