1PERLUTIL(1) Perl Programmers Reference Guide PERLUTIL(1)
2
3
4
6 perlutil - utilities packaged with the Perl distribution
7
9 Along with the Perl interpreter itself, the Perl distribution installs
10 a range of utilities on your system. There are also several utilities
11 which are used by the Perl distribution itself as part of the install
12 process. This document exists to list all of these utilities, explain
13 what they are for and provide pointers to each module's documentation,
14 if appropriate.
15
17 Documentation
18 perldoc
19 The main interface to Perl's documentation is "perldoc", although if
20 you're reading this, it's more than likely that you've already found
21 it. perldoc will extract and format the documentation from any file
22 in the current directory, any Perl module installed on the system,
23 or any of the standard documentation pages, such as this one. Use
24 "perldoc <name>" to get information on any of the utilities
25 described in this document.
26
27 pod2man and pod2text
28 If it's run from a terminal, perldoc will usually call pod2man to
29 translate POD (Plain Old Documentation - see perlpod for an
30 explanation) into a manpage, and then run man to display it; if man
31 isn't available, pod2text will be used instead and the output piped
32 through your favourite pager.
33
34 pod2html and pod2latex
35 As well as these two, there are two other converters: pod2html will
36 produce HTML pages from POD, and pod2latex, which produces LaTeX
37 files.
38
39 pod2usage
40 If you just want to know how to use the utilities described here,
41 pod2usage will just extract the "USAGE" section; some of the
42 utilities will automatically call pod2usage on themselves when you
43 call them with "-help".
44
45 podselect
46 pod2usage is a special case of podselect, a utility to extract named
47 sections from documents written in POD. For instance, while
48 utilities have "USAGE" sections, Perl modules usually have
49 "SYNOPSIS" sections: "podselect -s "SYNOPSIS" ..." will extract this
50 section for a given file.
51
52 podchecker
53 If you're writing your own documentation in POD, the podchecker
54 utility will look for errors in your markup.
55
56 splain
57 splain is an interface to perldiag - paste in your error message to
58 it, and it'll explain it for you.
59
60 "roffitall"
61 The "roffitall" utility is not installed on your system but lives in
62 the pod/ directory of your Perl source kit; it converts all the
63 documentation from the distribution to *roff format, and produces a
64 typeset PostScript or text file of the whole lot.
65
66 Converters
67 To help you convert legacy programs to Perl, we've included three
68 conversion filters:
69
70 a2p
71 a2p converts awk scripts to Perl programs; for example, "a2p -F:" on
72 the simple awk script "{print $2}" will produce a Perl program based
73 around this code:
74
75 while (<>) {
76 ($Fld1,$Fld2) = split(/[:\n]/, $_, -1);
77 print $Fld2;
78 }
79
80 s2p and psed
81 Similarly, s2p converts sed scripts to Perl programs. s2p run on
82 "s/foo/bar" will produce a Perl program based around this:
83
84 while (<>) {
85 chomp;
86 s/foo/bar/g;
87 print if $printit;
88 }
89
90 When invoked as psed, it behaves as a sed implementation, written in
91 Perl.
92
93 find2perl
94 Finally, find2perl translates "find" commands to Perl equivalents
95 which use the File::Find module. As an example, "find2perl . -user
96 root -perm 4000 -print" produces the following callback subroutine
97 for "File::Find":
98
99 sub wanted {
100 my ($dev,$ino,$mode,$nlink,$uid,$gid);
101 (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
102 $uid == $uid{'root'}) &&
103 (($mode & 0777) == 04000);
104 print("$name\n");
105 }
106
107 As well as these filters for converting other languages, the pl2pm
108 utility will help you convert old-style Perl 4 libraries to new-style
109 Perl5 modules.
110
111 Administration
112 config_data
113 Query or change configuration of Perl modules that use
114 Module::Build-based configuration files for features and config
115 data.
116
117 libnetcfg
118 To display and change the libnet configuration run the libnetcfg
119 command.
120
121 perlivp
122 The perlivp program is set up at Perl source code build time to test
123 the Perl version it was built under. It can be used after running
124 "make install" (or your platform's equivalent procedure) to verify
125 that perl and its libraries have been installed correctly.
126
127 Development
128 There are a set of utilities which help you in developing Perl
129 programs, and in particular, extending Perl with C.
130
131 perlbug
132 perlbug is the recommended way to report bugs in the perl
133 interpreter itself or any of the standard library modules back to
134 the developers; please read through the documentation for perlbug
135 thoroughly before using it to submit a bug report.
136
137 perlthanks
138 This program provides an easy way to send a thank-you message back
139 to the authors and maintainers of perl. It's just perlbug installed
140 under another name.
141
142 h2ph
143 Back before Perl had the XS system for connecting with C libraries,
144 programmers used to get library constants by reading through the C
145 header files. You may still see "require 'syscall.ph'" or similar
146 around - the .ph file should be created by running h2ph on the
147 corresponding .h file. See the h2ph documentation for more on how to
148 convert a whole bunch of header files at once.
149
150 c2ph and pstruct
151 c2ph and pstruct, which are actually the same program but behave
152 differently depending on how they are called, provide another way of
153 getting at C with Perl - they'll convert C structures and union
154 declarations to Perl code. This is deprecated in favour of h2xs
155 these days.
156
157 h2xs
158 h2xs converts C header files into XS modules, and will try and write
159 as much glue between C libraries and Perl modules as it can. It's
160 also very useful for creating skeletons of pure Perl modules.
161
162 enc2xs
163 enc2xs builds a Perl extension for use by Encode from either Unicode
164 Character Mapping files (.ucm) or Tcl Encoding Files (.enc).
165 Besides being used internally during the build process of the Encode
166 module, you can use enc2xs to add your own encoding to perl. No
167 knowledge of XS is necessary.
168
169 xsubpp
170 xsubpp is a compiler to convert Perl XS code into C code. It is
171 typically run by the makefiles created by ExtUtils::MakeMaker.
172
173 xsubpp will compile XS code into C code by embedding the constructs
174 necessary to let C functions manipulate Perl values and creates the
175 glue necessary to let Perl access those functions.
176
177 prove
178 prove is a command-line interface to the test-running functionality
179 of Test::Harness. It's an alternative to "make test".
180
181 corelist
182 A command-line front-end to "Module::CoreList", to query what
183 modules were shipped with given versions of perl.
184
185 General tools
186 A few general-purpose tools are shipped with perl, mostly because they
187 came along modules included in the perl distribution.
188
189 piconv
190 piconv is a Perl version of iconv, a character encoding converter
191 widely available for various Unixen today. This script was
192 primarily a technology demonstrator for Perl 5.8.0, but you can use
193 piconv in the place of iconv for virtually any case.
194
195 ptar
196 ptar is a tar-like program, written in pure Perl.
197
198 ptardiff
199 ptardiff is a small utility that produces a diff between an
200 extracted archive and an unextracted one. (Note that this utility
201 requires the "Text::Diff" module to function properly; this module
202 isn't distributed with perl, but is available from the CPAN.)
203
204 ptargrep
205 ptargrep is a utility to apply pattern matching to the contents of
206 files in a tar archive.
207
208 shasum
209 This utility, that comes with the "Digest::SHA" module, is used to
210 print or verify SHA checksums.
211
212 zipdetails
213 zipdetails displays information about the internal record structure
214 of the zip file. It is not concerned with displaying any details of
215 the compressed data stored in the zip file.
216
217 Installation
218 These utilities help manage extra Perl modules that don't come with the
219 perl distribution.
220
221 cpan
222 cpan is a command-line interface to CPAN.pm. It allows you to
223 install modules or distributions from CPAN, or just get information
224 about them, and a lot more. It is similar to the command line mode
225 of the CPAN module,
226
227 perl -MCPAN -e shell
228
229 cpanp
230 cpanp is, like cpan, a command-line interface to the CPAN, using the
231 "CPANPLUS" module as a back-end. It can be used interactively or
232 imperatively.
233
234 cpan2dist
235 cpan2dist is a tool to create distributions (or packages) from CPAN
236 modules, then suitable for your package manager of choice. Support
237 for specific formats are available from CPAN as "CPANPLUS::Dist::*"
238 modules.
239
240 instmodsh
241 A little interface to ExtUtils::Installed to examine installed
242 modules, validate your packlists and even create a tarball from an
243 installed module.
244
246 perldoc, pod2man, perlpod, pod2html, pod2usage, podselect, podchecker,
247 splain, perldiag, "roffitall|roffitall", a2p, s2p, find2perl,
248 File::Find, pl2pm, perlbug, h2ph, c2ph, h2xs, enc2xs, xsubpp, cpan,
249 cpanp, cpan2dist, instmodsh, piconv, prove, corelist, ptar, ptardiff,
250 shasum, zipdetails
251
252
253
254perl v5.16.3 2013-03-04 PERLUTIL(1)