Install Perl 5.8.8
[msysgit.git] / mingw / html / pod / perlutil.html
blob38759579a4e11fe464709eadfd9704323fc8dcd0
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>perlutil - utilities packaged with the Perl distribution</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;perlutil - utilities packaged with the Perl distribution</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#description">DESCRIPTION</a></li>
24 <ul>
26 <li><a href="#documentation">DOCUMENTATION</a></li>
27 <li><a href="#convertors">CONVERTORS</a></li>
28 <li><a href="#administration">Administration</a></li>
29 <li><a href="#development">Development</a></li>
30 <li><a href="#see_also">SEE ALSO</a></li>
31 </ul>
33 </ul>
34 <!-- INDEX END -->
36 <hr />
37 <p>
38 </p>
39 <h1><a name="name">NAME</a></h1>
40 <p>perlutil - utilities packaged with the Perl distribution</p>
41 <p>
42 </p>
43 <hr />
44 <h1><a name="description">DESCRIPTION</a></h1>
45 <p>Along with the Perl interpreter itself, the Perl distribution installs a
46 range of utilities on your system. There are also several utilities
47 which are used by the Perl distribution itself as part of the install
48 process. This document exists to list all of these utilities, explain
49 what they are for and provide pointers to each module's documentation,
50 if appropriate.</p>
51 <p>
52 </p>
53 <h2><a name="documentation">DOCUMENTATION</a></h2>
54 <dl>
55 <dt><strong><a name="item_perldoc_7cperldoc"><a href="file://C|\msysgit\mingw\html/pod/perldoc.html">perldoc</a></a></strong>
57 <dd>
58 <p>The main interface to Perl's documentation is <code>perldoc</code>, although
59 if you're reading this, it's more than likely that you've already found
60 it. <em>perldoc</em> will extract and format the documentation from any file
61 in the current directory, any Perl module installed on the system, or
62 any of the standard documentation pages, such as this one. Use
63 <code>perldoc &lt;name&gt;</code> to get information on any of the utilities
64 described in this document.</p>
65 </dd>
66 </li>
67 <dt><strong><a name="item_pod2man_7cpod2man_and_pod2text_7cpod2text"><a href="file://C|\msysgit\mingw\html/pod/pod2man.html">pod2man</a> and <a href="file://C|\msysgit\mingw\html/pod/pod2text.html">pod2text</a></a></strong>
69 <dd>
70 <p>If it's run from a terminal, <em>perldoc</em> will usually call <em>pod2man</em> to
71 translate POD (Plain Old Documentation - see <a href="file://C|\msysgit\mingw\html/pod/perlpod.html">the perlpod manpage</a> for an
72 explanation) into a manpage, and then run <em>man</em> to display it; if
73 <em>man</em> isn't available, <em>pod2text</em> will be used instead and the output
74 piped through your favourite pager.</p>
75 </dd>
76 </li>
77 <dt><strong><a name="item_pod2html_7cpod2html_and_pod2latex_7cpod2latex"><a href="file://C|\msysgit\mingw\html/pod/pod2html.html">pod2html</a> and <a href="file://C|\msysgit\mingw\html/pod/pod2latex.html">pod2latex</a></a></strong>
79 <dd>
80 <p>As well as these two, there are two other converters: <em>pod2html</em> will
81 produce HTML pages from POD, and <em>pod2latex</em>, which produces LaTeX
82 files.</p>
83 </dd>
84 </li>
85 <dt><strong><a name="item_pod2usage_7cpod2usage"><a href="file://C|\msysgit\mingw\html/pod/pod2usage.html">pod2usage</a></a></strong>
87 <dd>
88 <p>If you just want to know how to use the utilities described here,
89 <em>pod2usage</em> will just extract the ``USAGE'' section; some of
90 the utilities will automatically call <em>pod2usage</em> on themselves when
91 you call them with <code>-help</code>.</p>
92 </dd>
93 </li>
94 <dt><strong><a name="item_podselect_7cpodselect"><a href="file://C|\msysgit\mingw\html/pod/podselect.html">podselect</a></a></strong>
96 <dd>
97 <p><em>pod2usage</em> is a special case of <em>podselect</em>, a utility to extract
98 named sections from documents written in POD. For instance, while
99 utilities have ``USAGE'' sections, Perl modules usually have ``SYNOPSIS''
100 sections: <code>podselect -s &quot;SYNOPSIS&quot; ...</code> will extract this section for
101 a given file.</p>
102 </dd>
103 </li>
104 <dt><strong><a name="item_podchecker_7cpodchecker"><a href="file://C|\msysgit\mingw\html/pod/podchecker.html">podchecker</a></a></strong>
106 <dd>
107 <p>If you're writing your own documentation in POD, the <em>podchecker</em>
108 utility will look for errors in your markup.</p>
109 </dd>
110 </li>
111 <dt><strong><a name="item_splain_7csplain"><a href="file://C|\msysgit\mingw\html/utils/splain.html">splain</a></a></strong>
113 <dd>
114 <p><em>splain</em> is an interface to <a href="file://C|\msysgit\mingw\html/pod/perldiag.html">the perldiag manpage</a> - paste in your error message
115 to it, and it'll explain it for you.</p>
116 </dd>
117 </li>
118 <dt><strong><a name="item_roffitall_7croffitall"><em>roffitall</em></a></strong>
120 <dd>
121 <p>The <code>roffitall</code> utility is not installed on your system but lives in
122 the <em>pod/</em> directory of your Perl source kit; it converts all the
123 documentation from the distribution to <em>*roff</em> format, and produces a
124 typeset PostScript or text file of the whole lot.</p>
125 </dd>
126 </li>
127 </dl>
129 </p>
130 <h2><a name="convertors">CONVERTORS</a></h2>
131 <p>To help you convert legacy programs to Perl, we've included three
132 conversion filters:</p>
133 <dl>
134 <dt><strong><a name="item_a2p_7ca2p"><em>a2p</em></a></strong>
136 <dd>
137 <p><em>a2p</em> converts <em>awk</em> scripts to Perl programs; for example, <code>a2p -F:</code>
138 on the simple <em>awk</em> script <code>{print $2}</code> will produce a Perl program
139 based around this code:</p>
140 </dd>
141 <dd>
142 <pre>
143 while (&lt;&gt;) {
144 ($Fld1,$Fld2) = split(/[:\n]/, $_, 9999);
145 print $Fld2;
146 }</pre>
147 </dd>
148 </li>
149 <dt><strong><a name="item_s2p_7cs2p"><em>s2p</em></a></strong>
151 <dd>
152 <p>Similarly, <em>s2p</em> converts <em>sed</em> scripts to Perl programs. <em>s2p</em> run
153 on <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_s_"><code>s/foo/bar</code></a> will produce a Perl program based around this:</p>
154 </dd>
155 <dd>
156 <pre>
157 while (&lt;&gt;) {
158 chomp;
159 s/foo/bar/g;
160 print if $printit;
161 }</pre>
162 </dd>
163 </li>
164 <dt><strong><a name="item_find2perl_7cfind2perl"><em>find2perl</em></a></strong>
166 <dd>
167 <p>Finally, <em>find2perl</em> translates <code>find</code> commands to Perl equivalents which
168 use the <a href="file://C|\msysgit\mingw\html/lib/File/Find.html">File::Find</a> module. As an example,
169 <code>find2perl . -user root -perm 4000 -print</code> produces the following callback
170 subroutine for <code>File::Find</code>:</p>
171 </dd>
172 <dd>
173 <pre>
174 sub wanted {
175 my ($dev,$ino,$mode,$nlink,$uid,$gid);
176 (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &amp;&amp;
177 $uid == $uid{'root'}) &amp;&amp;
178 (($mode &amp; 0777) == 04000);
179 print(&quot;$name\n&quot;);
180 }</pre>
181 </dd>
182 </li>
183 </dl>
184 <p>As well as these filters for converting other languages, the
185 <a href="file://C|\msysgit\mingw\html/utils/pl2pm.html">pl2pm</a> utility will help you convert old-style Perl 4 libraries to
186 new-style Perl5 modules.</p>
188 </p>
189 <h2><a name="administration">Administration</a></h2>
190 <dl>
191 <dt><strong><a name="item_libnetcfg_7clibnetcfg"><a href="file://C|\msysgit\mingw\html/utils/libnetcfg.html">libnetcfg</a></a></strong>
193 <dd>
194 <p>To display and change the libnet configuration run the libnetcfg command.</p>
195 </dd>
196 </li>
197 </dl>
199 </p>
200 <h2><a name="development">Development</a></h2>
201 <p>There are a set of utilities which help you in developing Perl programs,
202 and in particular, extending Perl with C.</p>
203 <dl>
204 <dt><strong><a name="item_perlbug_7cperlbug"><a href="file://C|\msysgit\mingw\html/utils/perlbug.html">perlbug</a></a></strong>
206 <dd>
207 <p><em>perlbug</em> is the recommended way to report bugs in the perl interpreter
208 itself or any of the standard library modules back to the developers;
209 please read through the documentation for <em>perlbug</em> thoroughly before
210 using it to submit a bug report.</p>
211 </dd>
212 </li>
213 <dt><strong><a name="item_h2ph_7ch2ph"><a href="file://C|\msysgit\mingw\html/utils/h2ph.html">h2ph</a></a></strong>
215 <dd>
216 <p>Back before Perl had the XS system for connecting with C libraries,
217 programmers used to get library constants by reading through the C
218 header files. You may still see <code>require 'syscall.ph'</code> or similar
219 around - the <em>.ph</em> file should be created by running <em>h2ph</em> on the
220 corresponding <em>.h</em> file. See the <em>h2ph</em> documentation for more on how
221 to convert a whole bunch of header files at once.</p>
222 </dd>
223 </li>
224 <dt><strong><a name="item_c2ph_7cc2ph_and_pstruct_7cpstruct"><a href="file://C|\msysgit\mingw\html/utils/c2ph.html">c2ph</a> and <a href="file://C|\msysgit\mingw\html/utils/pstruct.html">pstruct</a></a></strong>
226 <dd>
227 <p><em>c2ph</em> and <em>pstruct</em>, which are actually the same program but behave
228 differently depending on how they are called, provide another way of
229 getting at C with Perl - they'll convert C structures and union declarations
230 to Perl code. This is deprecated in favour of <em>h2xs</em> these days.</p>
231 </dd>
232 </li>
233 <dt><strong><a name="item_h2xs_7ch2xs"><a href="file://C|\msysgit\mingw\html/utils/h2xs.html">h2xs</a></a></strong>
235 <dd>
236 <p><em>h2xs</em> converts C header files into XS modules, and will try and write
237 as much glue between C libraries and Perl modules as it can. It's also
238 very useful for creating skeletons of pure Perl modules.</p>
239 </dd>
240 </li>
241 <dt><strong><a name="item_dprofpp_7cdprofpp"><a href="file://C|\msysgit\mingw\html/utils/dprofpp.html">dprofpp</a></a></strong>
243 <dd>
244 <p>Perl comes with a profiler, the <em>Devel::DProf</em> module. The
245 <em>dprofpp</em> utility analyzes the output of this profiler and tells you
246 which subroutines are taking up the most run time. See <a href="file://C|\msysgit\mingw\html/lib/Devel/DProf.html">the Devel::DProf manpage</a>
247 for more information.</p>
248 </dd>
249 </li>
250 <dt><strong><a name="item_perlcc_7cperlcc"><a href="file://C|\msysgit\mingw\html/utils/perlcc.html">perlcc</a></a></strong>
252 <dd>
253 <p><em>perlcc</em> is the interface to the experimental Perl compiler suite.</p>
254 </dd>
255 </li>
256 </dl>
258 </p>
259 <h2><a name="see_also">SEE ALSO</a></h2>
260 <p><a href="file://C|\msysgit\mingw\html/pod/perldoc.html">perldoc</a>, <a href="file://C|\msysgit\mingw\html/pod/pod2man.html">pod2man</a>, <a href="file://C|\msysgit\mingw\html/pod/perlpod.html">the perlpod manpage</a>,
261 <a href="file://C|\msysgit\mingw\html/pod/pod2html.html">pod2html</a>, <a href="file://C|\msysgit\mingw\html/pod/pod2usage.html">pod2usage</a>, <a href="file://C|\msysgit\mingw\html/pod/podselect.html">podselect</a>,
262 <a href="file://C|\msysgit\mingw\html/pod/podchecker.html">podchecker</a>, <a href="file://C|\msysgit\mingw\html/utils/splain.html">splain</a>, <a href="file://C|\msysgit\mingw\html/pod/perldiag.html">the perldiag manpage</a>,
263 <em>roffitall</em>, <em>a2p</em>, <em>s2p</em>, <em>find2perl</em>,
264 <a href="file://C|\msysgit\mingw\html/lib/File/Find.html">File::Find</a>, <a href="file://C|\msysgit\mingw\html/utils/pl2pm.html">pl2pm</a>, <a href="file://C|\msysgit\mingw\html/utils/perlbug.html">perlbug</a>,
265 <a href="file://C|\msysgit\mingw\html/utils/h2ph.html">h2ph</a>, <a href="file://C|\msysgit\mingw\html/utils/c2ph.html">c2ph</a>, <a href="file://C|\msysgit\mingw\html/utils/h2xs.html">h2xs</a>, <a href="file://C|\msysgit\mingw\html/utils/dprofpp.html">dprofpp</a>,
266 <a href="file://C|\msysgit\mingw\html/lib/Devel/DProf.html">the Devel::DProf manpage</a>, <a href="file://C|\msysgit\mingw\html/utils/perlcc.html">perlcc</a></p>
267 <table border="0" width="100%" cellspacing="0" cellpadding="3">
268 <tr><td class="block" style="background-color: #cccccc" valign="middle">
269 <big><strong><span class="block">&nbsp;perlutil - utilities packaged with the Perl distribution</span></strong></big>
270 </td></tr>
271 </table>
273 </body>
275 </html>