<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-perl" role="wrap">
  <?dbhtml filename="perl.html"?>

  <sect1info condition="script">
    <productname>perl</productname>
    <productnumber>&perl-version;</productnumber>
    <address>&perl-url;</address>
  </sect1info>

  <title>Perl-&perl-version;</title>

  <indexterm zone="ch-system-perl">
    <primary sortas="a-Perl">Perl</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Perl 软件包包含实用报表提取语言。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&perl-ch6-sbu;</seg>
        <seg>&perl-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 Perl</title>

    <para>首先创建一个基本的 <filename>/etc/hosts</filename> 文件，
    Perl 的一个配置文件和可选的测试套件都会引用它：</para>

<screen><userinput remap="pre">echo "127.0.0.1 localhost $(hostname)" &gt; /etc/hosts</userinput></screen>

    <!--para>This version of Perl now builds the Compress::Raw::Zlib and 
    Compress::Raw::BZip2 modules. By
    default Perl will use an internal copy of the sources for the build.
    Issue the following command so that Perl will use the libraries
    installed on the system:</para-->
    <para>该版本的 Perl 会构建 Compress::Raw::ZLib 和 Compress::Raw::BZip2
		模块。默认情况下 Perl 会使用内部的 zlib 和 bzip2 源码副本构建它们，
		执行以下命令，使得 Perl 使用系统中已经安装好的库：</para>

<screen><userinput remap="pre">export BUILD_ZLIB=False
export BUILD_BZIP2=0</userinput></screen>
<!--
    <para>Apply a patch to allow the Errno.pm module and the h2ph
    program to build correctly when building with GCC 5:</para>

<screen><userinput remap="pre">patch -Np1 -i ../&perl-gcc5-fixes-patch;</userinput></screen>
-->
    <!--para>To have full control over the way Perl is set up, you can remove the
    <quote>-des</quote> options from the following command and hand-pick the way
    this package is built. Alternatively, use the command exactly as below to
    use the defaults that Perl auto-detects:</para-->
    <para>为了能够完全控制 Perl 的设置，您可以在以下命令中移除
		<quote>-des</quote> 选项，并手动选择构建该软件包的方式。
		或者，直接使用下面的命令，以使用 Perl 自动检测的默认值：</para>

<screen><userinput remap="configure">sh Configure -des -Dprefix=/usr                 \
                  -Dvendorprefix=/usr           \
                  -Dman1dir=/usr/share/man/man1 \
                  -Dman3dir=/usr/share/man/man3 \
                  -Dpager="/usr/bin/less -isR"  \
                  -Duseshrplib                  \
                  -Dusethreads</userinput></screen>

    <variablelist>
      <title>配置选项的含义</title>

      <varlistentry>
        <term><parameter>-Dvendorprefix=/usr</parameter></term>
        <listitem>
		  <para>这保证 <command>perl</command>
		  	  知道如何告知软件包应该在哪里安装它们的 perl 模块。</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>-Dpager="/usr/bin/less -isR"</parameter></term>
        <listitem>
		  <para>这保证该软件包使用<userinput>less</userinput>
		  	  对输出进行分页，而不是使用 <userinput>more</userinput>。
		  </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>-Dman1dir=/usr/share/man/man1
        -Dman3dir=/usr/share/man/man3</parameter></term>
        <listitem>
          <para>由于 Groff 还没有安装，<command>Configure</command>
          认为我们不需要 Perl 的 man 页面。这些参数覆盖这个判断。</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>-Duseshrplib</parameter></term>
        <listitem>
          <para>构建 libperl 共享库，一些 perl 模块需要它。</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>-Dusethreads</parameter></term>
        <listitem>
          <para>构建带有线程支持的 perl。</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para>编译该软件包：</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>为了测试编译结果 （需要约 11 SBU），执行以下命令：</para>

<screen><userinput remap="test">make -k test</userinput></screen>

    <note><para>由于使用了最新的 gdbm 版本，一项测试会失败。</para></note>

    <para>安装该软件包，并清理环境变量：</para>

<screen><userinput remap="install">make install
unset BUILD_ZLIB BUILD_BZIP2</userinput></screen>

  </sect2>

  <sect2 id="contents-perl" role="content">
    <title>Perl 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>
      <segtitle>安装的库</segtitle>
      <segtitle>安装的目录</segtitle>

      <seglistitem>
        <seg>c2ph, corelist, cpan, enc2xs, encguess, h2ph, h2xs, instmodsh,
        json_pp, libnetcfg, perl, perl&perl-version; (指向 perl 的硬链接),
        perlbug, perldoc, perlivp, perlthanks (指向 perlbug 的硬链接), piconv,
        pl2pm, pod2html, pod2man, pod2text, pod2usage, podchecker, podselect,
        prove, pstruct (指向 c2ph 的硬链接), ptar, ptardiff, ptargrep, shasum,
        splain, xsubpp, 以及 zipdetails</seg>
        <seg>很多，无法在这里列出</seg>
        <seg>/usr/lib/perl5</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="c2ph">
        <term><command>c2ph</command></term>
        <listitem>
          <para>转储如同
          <command>cc -g -S</command>生成的 C 结构体</para>
          <indexterm zone="ch-system-perl c2ph">
            <primary sortas="b-c2ph">c2ph</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="corelist">
        <term><command>corelist</command></term>
        <listitem>
          <para>Module::CoreList 的命令行前端</para>
          <indexterm zone="ch-system-perl corelist">
            <primary sortas="b-corelist">corelist</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="cpan">
        <term><command>cpan</command></term>
        <listitem>
          <para>通过命令行与综合 Perl 归档网络 (CPAN) 交互</para>
          <indexterm zone="ch-system-perl cpan">
            <primary sortas="b-cpan">cpan</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="enc2xs">
        <term><command>enc2xs</command></term>
        <listitem>
          <para>从 Unicode 字符映射或 Tcl 编码文件构建 Encode 模块使用的
          Perl 扩展</para>
          <indexterm zone="ch-system-perl enc2xs">
            <primary sortas="b-enc2xs">enc2xs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="encguess">
        <term><command>encguess</command></term>
        <listitem>
          <para>猜测一些文件的编码格式</para>
          <indexterm zone="ch-system-perl encguess">
            <primary sortas="b-encguess">encguess</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="h2ph">
        <term><command>h2ph</command></term>
        <listitem>
          <para>将 <filename class="extension">.h</filename> C 头文件转化为
          <filename class="extension">.ph</filename> Perl 头文件</para>
          <indexterm zone="ch-system-perl h2ph">
            <primary sortas="b-h2ph">h2ph</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="h2xs">
        <term><command>h2xs</command></term>
        <listitem>
          <para>将 <filename class="extension">.h</filename> C 头文件转化为
          Perl 扩展</para>
          <indexterm zone="ch-system-perl h2xs">
            <primary sortas="b-h2xs">h2xs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="instmodsh">
        <term><command>instmodsh</command></term>
        <listitem>
          <para>用于检验安装好的 Perl 模块的 shell 脚本，
          可以从安装好的模块创建压缩包</para>
          <indexterm zone="ch-system-perl instmodsh">
            <primary sortas="b-instmodsh">instmodsh</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="json_pp">
        <term><command>json_pp</command></term>
        <listitem>
          <para>在特定输入输出格式之间转化数据</para>
          <indexterm zone="ch-system-perl json_pp">
            <primary sortas="b-json_pp">json_pp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libnetcfg">
        <term><command>libnetcfg</command></term>
        <listitem>
          <para>可以被用于配置
          <filename class="libraryfile">libnet</filename> Perl 模块</para>
          <indexterm zone="ch-system-perl libnetcfg">
            <primary sortas="b-libnetcfg">libnetcfg</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perl">
        <term><command>perl</command></term>
        <listitem>
          <para>由 C 语言、<command>sed</command>、
          <command>awk</command> 和 <command>sh</command>
          的最好特性结合成的一门瑞士军刀式语言</para>
          <indexterm zone="ch-system-perl perl">
            <primary sortas="b-perl">perl</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perl-version">
        <term><command>perl&perl-version;</command></term>
        <listitem>
          <para>指向 <command>perl</command> 的硬链接</para>
          <indexterm zone="ch-system-perl perl-version">
            <primary sortas="b-perl&perl-version;">perl&perl-version;</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perlbug">
        <term><command>perlbug</command></term>
        <listitem>
          <para>用于创建关于 Perl 或者它附带的模块的 bug 报告，
          并用邮件发送它们</para>
          <indexterm zone="ch-system-perl perlbug">
            <primary sortas="b-perlbug">perlbug</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perldoc">
        <term><command>perldoc</command></term>
        <listitem>
          <para>显示集成在 Perl 安装目录树或某个 Perl 脚本中的一页
          pod 格式文档</para>
          <indexterm zone="ch-system-perl perldoc">
            <primary sortas="b-perldoc">perldoc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perlivp">
        <term><command>perlivp</command></term>
        <listitem>
          <para>Perl 安装检验程序；它可以被用于确认 Perl
          	  和它的库都安装正确</para>
          <indexterm zone="ch-system-perl perlivp">
            <primary sortas="b-perlivp">perlivp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="perlthanks">
        <term><command>perlthanks</command></term>
        <listitem>
          <para>用于生成发送给 Perl 开发者的感谢信</para>
          <indexterm zone="ch-system-perl perlthanks">
            <primary sortas="b-perlthanks">perlthanks</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="piconv">
        <term><command>piconv</command></term>
        <listitem>
          <para>字符编码转换器
          <command>iconv</command> 的 Perl 版本</para>
          <indexterm zone="ch-system-perl piconv">
            <primary sortas="b-piconv">piconv</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pl2pm">
        <term><command>pl2pm</command></term>
        <listitem>
          <para>一个用于将 Perl4
          <filename class="extension">.pl</filename> 文件转换成 Perl5
          <filename class="extension">.pm</filename> 模块的粗糙工具</para>
          <indexterm zone="ch-system-perl pl2pm">
            <primary sortas="b-pl2pm">pl2pm</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pod2html">
        <term><command>pod2html</command></term>
        <listitem>
          <para>将 pod 格式的文件转换为 HTML 格式</para>
          <indexterm zone="ch-system-perl pod2html">
            <primary sortas="b-pod2html">pod2html</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pod2man">
        <term><command>pod2man</command></term>
        <listitem>
          <para>将 pod 数据转换为格式化的 *roff 输入</para>
          <indexterm zone="ch-system-perl pod2man">
            <primary sortas="b-pod2man">pod2man</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pod2text">
        <term><command>pod2text</command></term>
        <listitem>
          <para>将 pod 数据转化为格式化的 ASCII 文本</para>
          <indexterm zone="ch-system-perl pod2text">
            <primary sortas="b-pod2text">pod2text</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pod2usage">
        <term><command>pod2usage</command></term>
        <listitem>
          <para>输出文件中嵌入的 pod 文档中的使用方法信息</para>
          <indexterm zone="ch-system-perl pod2usage">
            <primary sortas="b-pod2usage">pod2usage</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="podchecker">
        <term><command>podchecker</command></term>
        <listitem>
          <para>检查 pod 格式文档文件的语法</para>
          <indexterm zone="ch-system-perl podchecker">
            <primary sortas="b-podchecker">podchecker</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="podselect">
        <term><command>podselect</command></term>
        <listitem>
          <para>显示 pod 文档中的指定章节</para>
          <indexterm zone="ch-system-perl podselect">
            <primary sortas="b-podselect">podselect</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="prove">
        <term><command>prove</command></term>
        <listitem>
          <para>用于运行使用 Test::Harness 模块的测试</para>
          <indexterm zone="ch-system-perl prove">
            <primary sortas="b-prove">prove</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pstruct">
        <term><command>pstruct</command></term>
        <listitem>
          <para>转储如同 <command>cc -g -S</command>
          生成的结构体符号表</para>
          <indexterm zone="ch-system-perl pstruct">
            <primary sortas="b-pstruct">pstruct</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ptar">
        <term><command>ptar</command></term>
        <listitem>
          <para>一个 Perl 编写的类似 <command>tar</command> 的程序</para>
          <indexterm zone="ch-system-perl ptar">
            <primary sortas="b-ptar">ptar</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ptardiff">
        <term><command>ptardiff</command></term>
        <listitem>
          <para>一个比较压缩档案和未压缩版本的 Perl 程序</para>
          <indexterm zone="ch-system-perl ptardiff">
            <primary sortas="b-ptardiff">ptardiff</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ptargrep">
        <term><command>ptargrep</command></term>
        <listitem>
          <para>一个在 tar 档案中的文件内容上进行模式匹配的 Perl 程序</para>
          <indexterm zone="ch-system-perl ptargrep">
            <primary sortas="b-ptargrep">ptargrep</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="shasum">
        <term><command>shasum</command></term>
        <listitem>
          <para>打印或检查 SHA 校验和</para>
          <indexterm zone="ch-system-perl shasum">
            <primary sortas="b-shasum">shasum</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="splain">
        <term><command>splain</command></term>
        <listitem>
          <para>被用于 Perl 的强制性详细警告诊断</para>
          <indexterm zone="ch-system-perl splain">
            <primary sortas="b-splain">splain</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="xsubpp">
        <term><command>xsubpp</command></term>
        <listitem>
          <para>将 Perl XS 代码转换为 C 代码</para>
          <indexterm zone="ch-system-perl xsubpp">
            <primary sortas="b-xsubpp">xsubpp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="zipdetails">
        <term><command>zipdetails</command></term>
        <listitem>
          <para>显示 Zip 文件内部结构的详细信息</para>
          <indexterm zone="ch-system-perl zipdetails">
            <primary sortas="b-zipdetails">zipdetails</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
