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