Perl中的POD是什么?
Pod是一种易于使用的标记语言,用于编写Perl,Perl程序和Perl模块的文档。有多种翻译器可用于将Pod转换为各种格式,例如纯文本,HTML,手册页等。Pod标记包含三种基本类型的段落-
普通段落-您可以在普通段落中使用格式代码,包括粗体,斜体,代码样式,超链接等。
Verbatim段落-Verbatim段落通常用于表示不需要任何特殊解析或格式且不应包装的代码块或其他文本。
命令段落-命令段落用于特殊处理整个文本块,通常作为标题或列表的一部分。所有命令段落均以=开头,后跟一个标识符,然后是该命令可以随意使用的任意文本。当前公认的命令是-
=pod =head1 Heading Text =head2 Heading Text =head3 Heading Text =head4 Heading Text =over indentlevel =item stuff =back =begin format =end format =for format text... =encoding type =cut
POD示例
请看以下POD-
=head1 SYNOPSIS Copyright 2005 [TUTORIALSOPOINT]. =cut
您可以使用Linux上可用的pod2html实用程序将上述POD转换为HTML,因此它将产生以下结果-
版权所有2005[TUTORIALSOPOINT]
接下来,请看以下示例-
=head2 An Example List =over 4 =item * This is a bulleted list. =item * Here's another item. =back =begin html <p> Here's some embedded HTML. In this block I can include images, apply <span style="color: green"> styles</span>, or do anything else I can do with HTML. pod parsers that aren't outputting HTML will completely ignore it. </p> =end html
当您使用pod2html将上述POD转换为HTML时,它将产生以下结果-
An Example List This is a bulleted list. Here's another item. Here's some embedded HTML. In this block I can include images, apply styles, or do anything else I can do with HTML. pod parsers that aren't outputting HTML will completely ignore it.
热门推荐
10 病人祝福语老师寄语简短
11 新娘生孩子祝福语简短
12 婆婆66岁祝福语简短
13 今天孩子高考祝福语简短
14 送彩票生日祝福语简短
15 分别祝福语简短情话英文
16 画室揭牌仪式祝福语简短
17 女友妈妈生日祝福语简短
18 离别赠言离职祝福语简短