1
0

perl.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <?xml version="1.0" encoding="UTF-8"?>
  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. ]>
  7. <sect1 id="ch-system-perl" role="wrap">
  8. <?dbhtml filename="perl.html"?>
  9. <sect1info condition="script">
  10. <productname>perl</productname>
  11. <productnumber>&perl-version;</productnumber>
  12. <address>&perl-url;</address>
  13. </sect1info>
  14. <title>Perl-&perl-version;</title>
  15. <indexterm zone="ch-system-perl">
  16. <primary sortas="a-Perl">Perl</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Perl 软件包包含实用报表提取语言。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&perl-ch6-sbu;</seg>
  26. <seg>&perl-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Perl</title>
  32. <para>首先创建一个基本的 <filename>/etc/hosts</filename> 文件,
  33. Perl 的一个配置文件和可选的测试套件都会引用它:</para>
  34. <screen><userinput remap="pre">echo "127.0.0.1 localhost $(hostname)" &gt; /etc/hosts</userinput></screen>
  35. <!--para>This version of Perl now builds the Compress::Raw::Zlib and
  36. Compress::Raw::BZip2 modules. By
  37. default Perl will use an internal copy of the sources for the build.
  38. Issue the following command so that Perl will use the libraries
  39. installed on the system:</para-->
  40. <para>该版本的 Perl 会构建 Compress::Raw::ZLib 和 Compress::Raw::BZip2
  41. 模块。默认情况下 Perl 会使用内部的 zlib 和 bzip2 源码副本构建它们,
  42. 执行以下命令,使得 Perl 使用系统中已经安装好的库:</para>
  43. <screen><userinput remap="pre">export BUILD_ZLIB=False
  44. export BUILD_BZIP2=0</userinput></screen>
  45. <!--
  46. <para>Apply a patch to allow the Errno.pm module and the h2ph
  47. program to build correctly when building with GCC 5:</para>
  48. <screen><userinput remap="pre">patch -Np1 -i ../&perl-gcc5-fixes-patch;</userinput></screen>
  49. -->
  50. <!--para>To have full control over the way Perl is set up, you can remove the
  51. <quote>-des</quote> options from the following command and hand-pick the way
  52. this package is built. Alternatively, use the command exactly as below to
  53. use the defaults that Perl auto-detects:</para-->
  54. <para>为了能够完全控制 Perl 的设置,您可以在以下命令中移除
  55. <quote>-des</quote> 选项,并手动选择构建该软件包的方式。
  56. 或者,直接使用下面的命令,以使用 Perl 自动检测的默认值:</para>
  57. <screen><userinput remap="configure">sh Configure -des -Dprefix=/usr \
  58. -Dvendorprefix=/usr \
  59. -Dman1dir=/usr/share/man/man1 \
  60. -Dman3dir=/usr/share/man/man3 \
  61. -Dpager="/usr/bin/less -isR" \
  62. -Duseshrplib \
  63. -Dusethreads</userinput></screen>
  64. <variablelist>
  65. <title>配置选项的含义</title>
  66. <varlistentry>
  67. <term><parameter>-Dvendorprefix=/usr</parameter></term>
  68. <listitem>
  69. <para>这保证 <command>perl</command>
  70. 知道如何告知软件包应该在哪里安装它们的 perl 模块。</para>
  71. </listitem>
  72. </varlistentry>
  73. <varlistentry>
  74. <term><parameter>-Dpager="/usr/bin/less -isR"</parameter></term>
  75. <listitem>
  76. <para>这保证该软件包使用<userinput>less</userinput>
  77. 对输出进行分页,而不是使用 <userinput>more</userinput>。
  78. </para>
  79. </listitem>
  80. </varlistentry>
  81. <varlistentry>
  82. <term><parameter>-Dman1dir=/usr/share/man/man1
  83. -Dman3dir=/usr/share/man/man3</parameter></term>
  84. <listitem>
  85. <para>由于 Groff 还没有安装,<command>Configure</command>
  86. 认为我们不需要 Perl 的 man 页面。这些参数覆盖这个判断。</para>
  87. </listitem>
  88. </varlistentry>
  89. <varlistentry>
  90. <term><parameter>-Duseshrplib</parameter></term>
  91. <listitem>
  92. <para>构建 libperl 共享库,一些 perl 模块需要它。</para>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry>
  96. <term><parameter>-Dusethreads</parameter></term>
  97. <listitem>
  98. <para>构建带有线程支持的 perl。</para>
  99. </listitem>
  100. </varlistentry>
  101. </variablelist>
  102. <para>编译该软件包:</para>
  103. <screen><userinput remap="make">make</userinput></screen>
  104. <para>为了测试编译结果 (需要约 11 SBU),执行以下命令:</para>
  105. <screen><userinput remap="test">make -k test</userinput></screen>
  106. <note><para>由于使用了最新的 gdbm 版本,一项测试会失败。</para></note>
  107. <para>安装该软件包,并清理环境变量:</para>
  108. <screen><userinput remap="install">make install
  109. unset BUILD_ZLIB BUILD_BZIP2</userinput></screen>
  110. </sect2>
  111. <sect2 id="contents-perl" role="content">
  112. <title>Perl 的内容</title>
  113. <segmentedlist>
  114. <segtitle>安装的程序</segtitle>
  115. <segtitle>安装的库</segtitle>
  116. <segtitle>安装的目录</segtitle>
  117. <seglistitem>
  118. <seg>c2ph, corelist, cpan, enc2xs, encguess, h2ph, h2xs, instmodsh,
  119. json_pp, libnetcfg, perl, perl&perl-version; (指向 perl 的硬链接),
  120. perlbug, perldoc, perlivp, perlthanks (指向 perlbug 的硬链接), piconv,
  121. pl2pm, pod2html, pod2man, pod2text, pod2usage, podchecker, podselect,
  122. prove, pstruct (指向 c2ph 的硬链接), ptar, ptardiff, ptargrep, shasum,
  123. splain, xsubpp, 以及 zipdetails</seg>
  124. <seg>很多,无法在这里列出</seg>
  125. <seg>/usr/lib/perl5</seg>
  126. </seglistitem>
  127. </segmentedlist>
  128. <variablelist>
  129. <bridgehead renderas="sect3">简要描述</bridgehead>
  130. <?dbfo list-presentation="list"?>
  131. <?dbhtml list-presentation="table"?>
  132. <varlistentry id="c2ph">
  133. <term><command>c2ph</command></term>
  134. <listitem>
  135. <para>转储如同
  136. <command>cc -g -S</command>生成的 C 结构体</para>
  137. <indexterm zone="ch-system-perl c2ph">
  138. <primary sortas="b-c2ph">c2ph</primary>
  139. </indexterm>
  140. </listitem>
  141. </varlistentry>
  142. <varlistentry id="corelist">
  143. <term><command>corelist</command></term>
  144. <listitem>
  145. <para>Module::CoreList 的命令行前端</para>
  146. <indexterm zone="ch-system-perl corelist">
  147. <primary sortas="b-corelist">corelist</primary>
  148. </indexterm>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry id="cpan">
  152. <term><command>cpan</command></term>
  153. <listitem>
  154. <para>通过命令行与综合 Perl 归档网络 (CPAN) 交互</para>
  155. <indexterm zone="ch-system-perl cpan">
  156. <primary sortas="b-cpan">cpan</primary>
  157. </indexterm>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry id="enc2xs">
  161. <term><command>enc2xs</command></term>
  162. <listitem>
  163. <para>从 Unicode 字符映射或 Tcl 编码文件构建 Encode 模块使用的
  164. Perl 扩展</para>
  165. <indexterm zone="ch-system-perl enc2xs">
  166. <primary sortas="b-enc2xs">enc2xs</primary>
  167. </indexterm>
  168. </listitem>
  169. </varlistentry>
  170. <varlistentry id="encguess">
  171. <term><command>encguess</command></term>
  172. <listitem>
  173. <para>猜测一些文件的编码格式</para>
  174. <indexterm zone="ch-system-perl encguess">
  175. <primary sortas="b-encguess">encguess</primary>
  176. </indexterm>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="h2ph">
  180. <term><command>h2ph</command></term>
  181. <listitem>
  182. <para>将 <filename class="extension">.h</filename> C 头文件转化为
  183. <filename class="extension">.ph</filename> Perl 头文件</para>
  184. <indexterm zone="ch-system-perl h2ph">
  185. <primary sortas="b-h2ph">h2ph</primary>
  186. </indexterm>
  187. </listitem>
  188. </varlistentry>
  189. <varlistentry id="h2xs">
  190. <term><command>h2xs</command></term>
  191. <listitem>
  192. <para>将 <filename class="extension">.h</filename> C 头文件转化为
  193. Perl 扩展</para>
  194. <indexterm zone="ch-system-perl h2xs">
  195. <primary sortas="b-h2xs">h2xs</primary>
  196. </indexterm>
  197. </listitem>
  198. </varlistentry>
  199. <varlistentry id="instmodsh">
  200. <term><command>instmodsh</command></term>
  201. <listitem>
  202. <para>用于检验安装好的 Perl 模块的 shell 脚本,
  203. 可以从安装好的模块创建压缩包</para>
  204. <indexterm zone="ch-system-perl instmodsh">
  205. <primary sortas="b-instmodsh">instmodsh</primary>
  206. </indexterm>
  207. </listitem>
  208. </varlistentry>
  209. <varlistentry id="json_pp">
  210. <term><command>json_pp</command></term>
  211. <listitem>
  212. <para>在特定输入输出格式之间转化数据</para>
  213. <indexterm zone="ch-system-perl json_pp">
  214. <primary sortas="b-json_pp">json_pp</primary>
  215. </indexterm>
  216. </listitem>
  217. </varlistentry>
  218. <varlistentry id="libnetcfg">
  219. <term><command>libnetcfg</command></term>
  220. <listitem>
  221. <para>可以被用于配置
  222. <filename class="libraryfile">libnet</filename> Perl 模块</para>
  223. <indexterm zone="ch-system-perl libnetcfg">
  224. <primary sortas="b-libnetcfg">libnetcfg</primary>
  225. </indexterm>
  226. </listitem>
  227. </varlistentry>
  228. <varlistentry id="perl">
  229. <term><command>perl</command></term>
  230. <listitem>
  231. <para>由 C 语言、<command>sed</command>、
  232. <command>awk</command> 和 <command>sh</command>
  233. 的最好特性结合成的一门瑞士军刀式语言</para>
  234. <indexterm zone="ch-system-perl perl">
  235. <primary sortas="b-perl">perl</primary>
  236. </indexterm>
  237. </listitem>
  238. </varlistentry>
  239. <varlistentry id="perl-version">
  240. <term><command>perl&perl-version;</command></term>
  241. <listitem>
  242. <para>指向 <command>perl</command> 的硬链接</para>
  243. <indexterm zone="ch-system-perl perl-version">
  244. <primary sortas="b-perl&perl-version;">perl&perl-version;</primary>
  245. </indexterm>
  246. </listitem>
  247. </varlistentry>
  248. <varlistentry id="perlbug">
  249. <term><command>perlbug</command></term>
  250. <listitem>
  251. <para>用于创建关于 Perl 或者它附带的模块的 bug 报告,
  252. 并用邮件发送它们</para>
  253. <indexterm zone="ch-system-perl perlbug">
  254. <primary sortas="b-perlbug">perlbug</primary>
  255. </indexterm>
  256. </listitem>
  257. </varlistentry>
  258. <varlistentry id="perldoc">
  259. <term><command>perldoc</command></term>
  260. <listitem>
  261. <para>显示集成在 Perl 安装目录树或某个 Perl 脚本中的一页
  262. pod 格式文档</para>
  263. <indexterm zone="ch-system-perl perldoc">
  264. <primary sortas="b-perldoc">perldoc</primary>
  265. </indexterm>
  266. </listitem>
  267. </varlistentry>
  268. <varlistentry id="perlivp">
  269. <term><command>perlivp</command></term>
  270. <listitem>
  271. <para>Perl 安装检验程序;它可以被用于确认 Perl
  272. 和它的库都安装正确</para>
  273. <indexterm zone="ch-system-perl perlivp">
  274. <primary sortas="b-perlivp">perlivp</primary>
  275. </indexterm>
  276. </listitem>
  277. </varlistentry>
  278. <varlistentry id="perlthanks">
  279. <term><command>perlthanks</command></term>
  280. <listitem>
  281. <para>用于生成发送给 Perl 开发者的感谢信</para>
  282. <indexterm zone="ch-system-perl perlthanks">
  283. <primary sortas="b-perlthanks">perlthanks</primary>
  284. </indexterm>
  285. </listitem>
  286. </varlistentry>
  287. <varlistentry id="piconv">
  288. <term><command>piconv</command></term>
  289. <listitem>
  290. <para>字符编码转换器
  291. <command>iconv</command> 的 Perl 版本</para>
  292. <indexterm zone="ch-system-perl piconv">
  293. <primary sortas="b-piconv">piconv</primary>
  294. </indexterm>
  295. </listitem>
  296. </varlistentry>
  297. <varlistentry id="pl2pm">
  298. <term><command>pl2pm</command></term>
  299. <listitem>
  300. <para>一个用于将 Perl4
  301. <filename class="extension">.pl</filename> 文件转换成 Perl5
  302. <filename class="extension">.pm</filename> 模块的粗糙工具</para>
  303. <indexterm zone="ch-system-perl pl2pm">
  304. <primary sortas="b-pl2pm">pl2pm</primary>
  305. </indexterm>
  306. </listitem>
  307. </varlistentry>
  308. <varlistentry id="pod2html">
  309. <term><command>pod2html</command></term>
  310. <listitem>
  311. <para>将 pod 格式的文件转换为 HTML 格式</para>
  312. <indexterm zone="ch-system-perl pod2html">
  313. <primary sortas="b-pod2html">pod2html</primary>
  314. </indexterm>
  315. </listitem>
  316. </varlistentry>
  317. <varlistentry id="pod2man">
  318. <term><command>pod2man</command></term>
  319. <listitem>
  320. <para>将 pod 数据转换为格式化的 *roff 输入</para>
  321. <indexterm zone="ch-system-perl pod2man">
  322. <primary sortas="b-pod2man">pod2man</primary>
  323. </indexterm>
  324. </listitem>
  325. </varlistentry>
  326. <varlistentry id="pod2text">
  327. <term><command>pod2text</command></term>
  328. <listitem>
  329. <para>将 pod 数据转化为格式化的 ASCII 文本</para>
  330. <indexterm zone="ch-system-perl pod2text">
  331. <primary sortas="b-pod2text">pod2text</primary>
  332. </indexterm>
  333. </listitem>
  334. </varlistentry>
  335. <varlistentry id="pod2usage">
  336. <term><command>pod2usage</command></term>
  337. <listitem>
  338. <para>输出文件中嵌入的 pod 文档中的使用方法信息</para>
  339. <indexterm zone="ch-system-perl pod2usage">
  340. <primary sortas="b-pod2usage">pod2usage</primary>
  341. </indexterm>
  342. </listitem>
  343. </varlistentry>
  344. <varlistentry id="podchecker">
  345. <term><command>podchecker</command></term>
  346. <listitem>
  347. <para>检查 pod 格式文档文件的语法</para>
  348. <indexterm zone="ch-system-perl podchecker">
  349. <primary sortas="b-podchecker">podchecker</primary>
  350. </indexterm>
  351. </listitem>
  352. </varlistentry>
  353. <varlistentry id="podselect">
  354. <term><command>podselect</command></term>
  355. <listitem>
  356. <para>显示 pod 文档中的指定章节</para>
  357. <indexterm zone="ch-system-perl podselect">
  358. <primary sortas="b-podselect">podselect</primary>
  359. </indexterm>
  360. </listitem>
  361. </varlistentry>
  362. <varlistentry id="prove">
  363. <term><command>prove</command></term>
  364. <listitem>
  365. <para>用于运行使用 Test::Harness 模块的测试</para>
  366. <indexterm zone="ch-system-perl prove">
  367. <primary sortas="b-prove">prove</primary>
  368. </indexterm>
  369. </listitem>
  370. </varlistentry>
  371. <varlistentry id="pstruct">
  372. <term><command>pstruct</command></term>
  373. <listitem>
  374. <para>转储如同 <command>cc -g -S</command>
  375. 生成的结构体符号表</para>
  376. <indexterm zone="ch-system-perl pstruct">
  377. <primary sortas="b-pstruct">pstruct</primary>
  378. </indexterm>
  379. </listitem>
  380. </varlistentry>
  381. <varlistentry id="ptar">
  382. <term><command>ptar</command></term>
  383. <listitem>
  384. <para>一个 Perl 编写的类似 <command>tar</command> 的程序</para>
  385. <indexterm zone="ch-system-perl ptar">
  386. <primary sortas="b-ptar">ptar</primary>
  387. </indexterm>
  388. </listitem>
  389. </varlistentry>
  390. <varlistentry id="ptardiff">
  391. <term><command>ptardiff</command></term>
  392. <listitem>
  393. <para>一个比较压缩档案和未压缩版本的 Perl 程序</para>
  394. <indexterm zone="ch-system-perl ptardiff">
  395. <primary sortas="b-ptardiff">ptardiff</primary>
  396. </indexterm>
  397. </listitem>
  398. </varlistentry>
  399. <varlistentry id="ptargrep">
  400. <term><command>ptargrep</command></term>
  401. <listitem>
  402. <para>一个在 tar 档案中的文件内容上进行模式匹配的 Perl 程序</para>
  403. <indexterm zone="ch-system-perl ptargrep">
  404. <primary sortas="b-ptargrep">ptargrep</primary>
  405. </indexterm>
  406. </listitem>
  407. </varlistentry>
  408. <varlistentry id="shasum">
  409. <term><command>shasum</command></term>
  410. <listitem>
  411. <para>打印或检查 SHA 校验和</para>
  412. <indexterm zone="ch-system-perl shasum">
  413. <primary sortas="b-shasum">shasum</primary>
  414. </indexterm>
  415. </listitem>
  416. </varlistentry>
  417. <varlistentry id="splain">
  418. <term><command>splain</command></term>
  419. <listitem>
  420. <para>被用于 Perl 的强制性详细警告诊断</para>
  421. <indexterm zone="ch-system-perl splain">
  422. <primary sortas="b-splain">splain</primary>
  423. </indexterm>
  424. </listitem>
  425. </varlistentry>
  426. <varlistentry id="xsubpp">
  427. <term><command>xsubpp</command></term>
  428. <listitem>
  429. <para>将 Perl XS 代码转换为 C 代码</para>
  430. <indexterm zone="ch-system-perl xsubpp">
  431. <primary sortas="b-xsubpp">xsubpp</primary>
  432. </indexterm>
  433. </listitem>
  434. </varlistentry>
  435. <varlistentry id="zipdetails">
  436. <term><command>zipdetails</command></term>
  437. <listitem>
  438. <para>显示 Zip 文件内部结构的详细信息</para>
  439. <indexterm zone="ch-system-perl zipdetails">
  440. <primary sortas="b-zipdetails">zipdetails</primary>
  441. </indexterm>
  442. </listitem>
  443. </varlistentry>
  444. </variablelist>
  445. </sect2>
  446. </sect1>