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 简短新年年会祝福语
13 评论小品祝福语大全简短
14 恭喜师兄结婚祝福语简短
15 员工集体辞职祝福语简短
16 高中新生祝福语 简短
17 装修祝福语男生搞笑简短
18 生日开业蛋糕祝福语简短