Update to systemd-231
[linux_from_scratch.git] / BOOK / chapter06 / perl.xml
blob5922e44fce4ba2e73b2ad003003be661645ad2ed
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4   <!ENTITY % general-entities SYSTEM "../general.ent">
5   %general-entities;
6 ]>
8 <sect1 id="ch-system-perl" role="wrap">
9   <?dbhtml filename="perl.html"?>
11   <sect1info condition="script">
12     <productname>perl</productname>
13     <productnumber>&perl-version;</productnumber>
14     <address>&perl-url;</address>
15   </sect1info>
17   <title>Perl-&perl-version;</title>
19   <indexterm zone="ch-system-perl">
20     <primary sortas="a-Perl">Perl</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The Perl package contains the Practical Extraction and Report
27     Language.</para>
29     <segmentedlist>
30       <segtitle>&buildtime;</segtitle>
31       <segtitle>&diskspace;</segtitle>
33       <seglistitem>
34         <seg>&perl-ch6-sbu;</seg>
35         <seg>&perl-ch6-du;</seg>
36       </seglistitem>
37     </segmentedlist>
39   </sect2>
41   <sect2 role="installation">
42     <title>Installation of Perl</title>
44     <para>First create a basic <filename>/etc/hosts</filename> file to be
45     referenced in one of Perl's configuration files as well as the optional
46     test suite:</para>
48 <screen><userinput remap="pre">echo "127.0.0.1 localhost $(hostname)" &gt; /etc/hosts</userinput></screen>
50     <para>This version of Perl now builds the Compress::Raw::Zlib and 
51     Compress::Raw::BZip2 modules. By
52     default Perl will use an internal copy of the sources for the build.
53     Issue the following command so that Perl will use the libraries
54     installed on the system:</para>
56 <screen><userinput remap="pre">export BUILD_ZLIB=False
57 export BUILD_BZIP2=0</userinput></screen>
58 <!--
59     <para>Apply a patch to allow the Errno.pm module and the h2ph
60     program to build correctly when building with GCC 5:</para>
62 <screen><userinput remap="pre">patch -Np1 -i ../&perl-gcc5-fixes-patch;</userinput></screen>
63 -->
64     <para>To have full control over the way Perl is set up, you can remove the
65     <quote>-des</quote> options from the following command and hand-pick the way
66     this package is built. Alternatively, use the command exactly as below to
67     use the defaults that Perl auto-detects:</para>
69 <screen><userinput remap="configure">sh Configure -des -Dprefix=/usr                 \
70                   -Dvendorprefix=/usr           \
71                   -Dman1dir=/usr/share/man/man1 \
72                   -Dman3dir=/usr/share/man/man3 \
73                   -Dpager="/usr/bin/less -isR"  \
74                   -Duseshrplib</userinput></screen>
76     <variablelist>
77       <title>The meaning of the configure options:</title>
79       <varlistentry>
80         <term><parameter>-Dvendorprefix=/usr</parameter></term>
81         <listitem>
82           <para>This ensures <command>perl</command> knows how to
83           tell packages where they should install their perl modules.</para>
84         </listitem>
85       </varlistentry>
87       <varlistentry>
88         <term><parameter>-Dpager="/usr/bin/less -isR"</parameter></term>
89         <listitem>
90           <para>This ensures that <userinput>less</userinput> is used instead 
91           of <userinput>more</userinput>.</para>
92         </listitem>
93       </varlistentry>
95       <varlistentry>
96         <term><parameter>-Dman1dir=/usr/share/man/man1
97         -Dman3dir=/usr/share/man/man3</parameter></term>
98         <listitem>
99           <para>Since Groff is not installed yet, <command>Configure</command>
100           thinks that we do not want man pages for Perl.  Issuing these
101           parameters overrides this decision.</para>
102         </listitem>
103       </varlistentry>
105       <varlistentry>
106         <term><parameter>-Duseshrplib</parameter></term>
107         <listitem>
108           <para>Build a shared libperl needed by some perl modules.</para>
109         </listitem>
110       </varlistentry>
112     </variablelist>
114     <para>Compile the package:</para>
116 <screen><userinput remap="make">make</userinput></screen>
118     <para>To test the results (approximately 2.5 SBU), issue:</para>
120 <screen><userinput remap="test">make -k test</userinput></screen>
122     <para>Install the package and clean up:</para>
124 <screen><userinput remap="install">make install
125 unset BUILD_ZLIB BUILD_BZIP2</userinput></screen>
127   </sect2>
129   <sect2 id="contents-perl" role="content">
130     <title>Contents of Perl</title>
132     <segmentedlist>
133       <segtitle>Installed programs</segtitle>
134       <segtitle>Installed libraries</segtitle>
135       <segtitle>Installed directory</segtitle>
137       <seglistitem>
138         <seg>c2ph, corelist, cpan, enc2xs, encguess, h2ph, h2xs, instmodsh,
139         json_pp, libnetcfg, perl, perl&perl-version; (hard link to perl),
140         perlbug, perldoc, perlivp, perlthanks (hard link to perlbug), piconv,
141         pl2pm, pod2html, pod2man, pod2text, pod2usage, podchecker, podselect,
142         prove, pstruct (hard link to c2ph), ptar, ptardiff, ptargrep, shasum,
143         splain, xsubpp, and zipdetails</seg>
144         <seg>Many which cannot all be listed here</seg>
145         <seg>/usr/lib/perl5</seg>
146       </seglistitem>
147     </segmentedlist>
149     <variablelist>
150       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
151       <?dbfo list-presentation="list"?>
152       <?dbhtml list-presentation="table"?>
154       <varlistentry id="a2p">
155         <term><command>a2p</command></term>
156         <listitem>
157           <para>Translates awk to Perl</para>
158           <indexterm zone="ch-system-perl a2p">
159             <primary sortas="b-a2p">a2p</primary>
160           </indexterm>
161         </listitem>
162       </varlistentry>
164       <varlistentry id="c2ph">
165         <term><command>c2ph</command></term>
166         <listitem>
167           <para>Dumps C structures as generated from
168           <command>cc -g -S</command></para>
169           <indexterm zone="ch-system-perl c2ph">
170             <primary sortas="b-c2ph">c2ph</primary>
171           </indexterm>
172         </listitem>
173       </varlistentry>
175       <varlistentry id="corelist">
176         <term><command>corelist</command></term>
177         <listitem>
178           <para>A commandline frontend to Module::CoreList</para>
179           <indexterm zone="ch-system-perl corelist">
180             <primary sortas="b-corelist">corelist</primary>
181           </indexterm>
182         </listitem>
183       </varlistentry>
185       <varlistentry id="cpan">
186         <term><command>cpan</command></term>
187         <listitem>
188           <para>Interact with the Comprehensive Perl Archive Network (CPAN)
189           from the command line</para>
190           <indexterm zone="ch-system-perl cpan">
191             <primary sortas="b-cpan">cpan</primary>
192           </indexterm>
193         </listitem>
194       </varlistentry>
196       <varlistentry id="cpan2dist">
197         <term><command>cpan2dist</command></term>
198         <listitem>
199           <para>The CPANPLUS distribution creator</para>
200           <indexterm zone="ch-system-perl cpan2dist">
201             <primary sortas="b-cpan2dist">cpan2dist</primary>
202           </indexterm>
203         </listitem>
204       </varlistentry>
206       <varlistentry id="cpanp">
207         <term><command>cpanp</command></term>
208         <listitem>
209           <para>The CPANPLUS launcher</para>
210           <indexterm zone="ch-system-perl cpanp">
211             <primary sortas="b-cpanp">cpanp</primary>
212           </indexterm>
213         </listitem>
214       </varlistentry>
216       <varlistentry id="cpanp-run-perl">
217         <term><command>cpanp-run-perl</command></term>
218         <listitem>
219           <para>Perl script that is used to enable flushing of the output
220           buffer after each write in spawned processes</para>
221           <indexterm zone="ch-system-perl cpanp-run-perl">
222             <primary sortas="b-cpanp-run-perl">cpanp-run-perl</primary>
223           </indexterm>
224         </listitem>
225       </varlistentry>
227       <varlistentry id="enc2xs">
228         <term><command>enc2xs</command></term>
229         <listitem>
230           <para>Builds a Perl extension for the Encode module from either
231           Unicode Character Mappings or Tcl Encoding Files</para>
232           <indexterm zone="ch-system-perl enc2xs">
233             <primary sortas="b-enc2xs">enc2xs</primary>
234           </indexterm>
235         </listitem>
236       </varlistentry>
238       <varlistentry id="encguess">
239         <term><command>encguess</command></term>
240         <listitem>
241           <para>Guess the encoding type of one or several files</para>
242           <indexterm zone="ch-system-perl encguess">
243             <primary sortas="b-encguess">encguess</primary>
244           </indexterm>
245         </listitem>
246       </varlistentry>
248       <varlistentry id="find2perl">
249         <term><command>find2perl</command></term>
250         <listitem>
251           <para>Translates <command>find</command> commands to Perl</para>
252           <indexterm zone="ch-system-perl find2perl">
253             <primary sortas="b-find2perl">find2perl</primary>
254           </indexterm>
255         </listitem>
256       </varlistentry>
258       <varlistentry id="h2ph">
259         <term><command>h2ph</command></term>
260         <listitem>
261           <para>Converts <filename class="extension">.h</filename> C header
262           files to <filename class="extension">.ph</filename> Perl header
263           files</para>
264           <indexterm zone="ch-system-perl h2ph">
265             <primary sortas="b-h2ph">h2ph</primary>
266           </indexterm>
267         </listitem>
268       </varlistentry>
270       <varlistentry id="h2xs">
271         <term><command>h2xs</command></term>
272         <listitem>
273           <para>Converts <filename class="extension">.h</filename> C header
274           files to Perl extensions</para>
275           <indexterm zone="ch-system-perl h2xs">
276             <primary sortas="b-h2xs">h2xs</primary>
277           </indexterm>
278         </listitem>
279       </varlistentry>
281       <varlistentry id="instmodsh">
282         <term><command>instmodsh</command></term>
283         <listitem>
284           <para>Shell script for examining installed Perl modules,
285           and can even create a tarball from an installed module</para>
286           <indexterm zone="ch-system-perl instmodsh">
287             <primary sortas="b-instmodsh">instmodsh</primary>
288           </indexterm>
289         </listitem>
290       </varlistentry>
292       <varlistentry id="json_pp">
293         <term><command>json_pp</command></term>
294         <listitem>
295           <para>Converts data between certain input and output formats</para>
296           <indexterm zone="ch-system-perl json_pp">
297             <primary sortas="b-json_pp">json_pp</primary>
298           </indexterm>
299         </listitem>
300       </varlistentry>
302       <varlistentry id="libnetcfg">
303         <term><command>libnetcfg</command></term>
304         <listitem>
305           <para>Can be used to configure the
306           <filename class="libraryfile">libnet</filename> Perl module</para>
307           <indexterm zone="ch-system-perl libnetcfg">
308             <primary sortas="b-libnetcfg">libnetcfg</primary>
309           </indexterm>
310         </listitem>
311       </varlistentry>
313       <varlistentry id="perl">
314         <term><command>perl</command></term>
315         <listitem>
316           <para>Combines some of the best features of C, <command>sed</command>,
317           <command>awk</command> and <command>sh</command> into a single
318           swiss-army language</para>
319           <indexterm zone="ch-system-perl perl">
320             <primary sortas="b-perl">perl</primary>
321           </indexterm>
322         </listitem>
323       </varlistentry>
325       <varlistentry id="perl-version">
326         <term><command>perl&perl-version;</command></term>
327         <listitem>
328           <para>A hard link to <command>perl</command></para>
329           <indexterm zone="ch-system-perl perl-version">
330             <primary sortas="b-perl&perl-version;">perl&perl-version;</primary>
331           </indexterm>
332         </listitem>
333       </varlistentry>
335       <varlistentry id="perlbug">
336         <term><command>perlbug</command></term>
337         <listitem>
338           <para>Used to generate bug reports about Perl, or the modules that come
339           with it, and mail them</para>
340           <indexterm zone="ch-system-perl perlbug">
341             <primary sortas="b-perlbug">perlbug</primary>
342           </indexterm>
343         </listitem>
344       </varlistentry>
346       <varlistentry id="perldoc">
347         <term><command>perldoc</command></term>
348         <listitem>
349           <para>Displays a piece of documentation in pod format that is embedded
350           in the Perl installation tree or in a Perl script</para>
351           <indexterm zone="ch-system-perl perldoc">
352             <primary sortas="b-perldoc">perldoc</primary>
353           </indexterm>
354         </listitem>
355       </varlistentry>
357       <varlistentry id="perlivp">
358         <term><command>perlivp</command></term>
359         <listitem>
360           <para>The Perl Installation Verification Procedure; it can be used to
361           verify that Perl and its libraries have been installed
362           correctly</para>
363           <indexterm zone="ch-system-perl perlivp">
364             <primary sortas="b-perlivp">perlivp</primary>
365           </indexterm>
366         </listitem>
367       </varlistentry>
369       <varlistentry id="perlthanks">
370         <term><command>perlthanks</command></term>
371         <listitem>
372           <para>Used to generate thank you messages to mail to the Perl
373           developers</para>
374           <indexterm zone="ch-system-perl perlthanks">
375             <primary sortas="b-perlthanks">perlthanks</primary>
376           </indexterm>
377         </listitem>
378       </varlistentry>
380       <varlistentry id="piconv">
381         <term><command>piconv</command></term>
382         <listitem>
383           <para>A Perl version of the character encoding converter
384           <command>iconv</command></para>
385           <indexterm zone="ch-system-perl piconv">
386             <primary sortas="b-piconv">piconv</primary>
387           </indexterm>
388         </listitem>
389       </varlistentry>
391       <varlistentry id="pl2pm">
392         <term><command>pl2pm</command></term>
393         <listitem>
394           <para>A rough tool for converting Perl4
395           <filename class="extension">.pl</filename> files to Perl5
396           <filename class="extension">.pm</filename> modules</para>
397           <indexterm zone="ch-system-perl pl2pm">
398             <primary sortas="b-pl2pm">pl2pm</primary>
399           </indexterm>
400         </listitem>
401       </varlistentry>
403       <varlistentry id="pod2html">
404         <term><command>pod2html</command></term>
405         <listitem>
406           <para>Converts files from pod format to HTML format</para>
407           <indexterm zone="ch-system-perl pod2html">
408             <primary sortas="b-pod2html">pod2html</primary>
409           </indexterm>
410         </listitem>
411       </varlistentry>
413       <varlistentry id="pod2latex">
414         <term><command>pod2latex</command></term>
415         <listitem>
416           <para>Converts files from pod format to LaTeX format</para>
417           <indexterm zone="ch-system-perl pod2latex">
418             <primary sortas="b-pod2latex">pod2latex</primary>
419           </indexterm>
420         </listitem>
421       </varlistentry>
423       <varlistentry id="pod2man">
424         <term><command>pod2man</command></term>
425         <listitem>
426           <para>Converts pod data to formatted *roff input</para>
427           <indexterm zone="ch-system-perl pod2man">
428             <primary sortas="b-pod2man">pod2man</primary>
429           </indexterm>
430         </listitem>
431       </varlistentry>
433       <varlistentry id="pod2text">
434         <term><command>pod2text</command></term>
435         <listitem>
436           <para>Converts pod data to formatted ASCII text</para>
437           <indexterm zone="ch-system-perl pod2text">
438             <primary sortas="b-pod2text">pod2text</primary>
439           </indexterm>
440         </listitem>
441       </varlistentry>
443       <varlistentry id="pod2usage">
444         <term><command>pod2usage</command></term>
445         <listitem>
446           <para>Prints usage messages from embedded pod docs in files</para>
447           <indexterm zone="ch-system-perl pod2usage">
448             <primary sortas="b-pod2usage">pod2usage</primary>
449           </indexterm>
450         </listitem>
451       </varlistentry>
453       <varlistentry id="podchecker">
454         <term><command>podchecker</command></term>
455         <listitem>
456           <para>Checks the syntax of pod format documentation files</para>
457           <indexterm zone="ch-system-perl podchecker">
458             <primary sortas="b-podchecker">podchecker</primary>
459           </indexterm>
460         </listitem>
461       </varlistentry>
463       <varlistentry id="podselect">
464         <term><command>podselect</command></term>
465         <listitem>
466           <para>Displays selected sections of pod documentation</para>
467           <indexterm zone="ch-system-perl podselect">
468             <primary sortas="b-podselect">podselect</primary>
469           </indexterm>
470         </listitem>
471       </varlistentry>
473       <varlistentry id="prove">
474         <term><command>prove</command></term>
475         <listitem>
476           <para>Command line tool for running tests against the Test::Harness
477           module</para>
478           <indexterm zone="ch-system-perl prove">
479             <primary sortas="b-prove">prove</primary>
480           </indexterm>
481         </listitem>
482       </varlistentry>
484       <varlistentry id="pstruct">
485         <term><command>pstruct</command></term>
486         <listitem>
487           <para>Dumps C structures as generated from <command>cc -g -S</command>
488           stabs</para>
489           <indexterm zone="ch-system-perl pstruct">
490             <primary sortas="b-pstruct">pstruct</primary>
491           </indexterm>
492         </listitem>
493       </varlistentry>
495       <varlistentry id="ptar">
496         <term><command>ptar</command></term>
497         <listitem>
498           <para>A <command>tar</command>-like program written in Perl</para>
499           <indexterm zone="ch-system-perl ptar">
500             <primary sortas="b-ptar">ptar</primary>
501           </indexterm>
502         </listitem>
503       </varlistentry>
505       <varlistentry id="ptardiff">
506         <term><command>ptardiff</command></term>
507         <listitem>
508           <para>A Perl program that compares an extracted archive with an
509           unextracted one</para>
510           <indexterm zone="ch-system-perl ptardiff">
511             <primary sortas="b-ptardiff">ptardiff</primary>
512           </indexterm>
513         </listitem>
514       </varlistentry>
516       <varlistentry id="ptargrep">
517         <term><command>ptargrep</command></term>
518         <listitem>
519           <para>A Perl program that applies pattern matching to the contents
520           of files in a tar archive</para>
521           <indexterm zone="ch-system-perl ptargrep">
522             <primary sortas="b-ptargrep">ptargrep</primary>
523           </indexterm>
524         </listitem>
525       </varlistentry>
527       <varlistentry id="s2p">
528         <term><command>s2p</command></term>
529         <listitem>
530           <para>Translates <command>sed</command> scripts to Perl</para>
531           <indexterm zone="ch-system-perl s2p">
532             <primary sortas="b-s2p">s2p</primary>
533           </indexterm>
534         </listitem>
535       </varlistentry>
537       <varlistentry id="shasum">
538         <term><command>shasum</command></term>
539         <listitem>
540           <para>Prints or checks SHA checksums</para>
541           <indexterm zone="ch-system-perl shasum">
542             <primary sortas="b-shasum">shasum</primary>
543           </indexterm>
544         </listitem>
545       </varlistentry>
547       <varlistentry id="splain">
548         <term><command>splain</command></term>
549         <listitem>
550           <para>Is used to force verbose warning diagnostics in Perl</para>
551           <indexterm zone="ch-system-perl splain">
552             <primary sortas="b-splain">splain</primary>
553           </indexterm>
554         </listitem>
555       </varlistentry>
557       <varlistentry id="xsubpp">
558         <term><command>xsubpp</command></term>
559         <listitem>
560           <para>Converts Perl XS code into C code</para>
561           <indexterm zone="ch-system-perl xsubpp">
562             <primary sortas="b-xsubpp">xsubpp</primary>
563           </indexterm>
564         </listitem>
565       </varlistentry>
567       <varlistentry id="zipdetails">
568         <term><command>zipdetails</command></term>
569         <listitem>
570           <para>Displays details about the internal structure of a Zip file</para>
571           <indexterm zone="ch-system-perl zipdetails">
572             <primary sortas="b-zipdetails">zipdetails</primary>
573           </indexterm>
574         </listitem>
575       </varlistentry>
577     </variablelist>
579   </sect2>
581 </sect1>