Perl POD 用法

POD(Plain Old Documentation)
直接嵌入在代码中,方便添加,同时方便查看。程序员要养成良好的文档习惯。

语法

=pod

=head1 NAME 不同的标题号代表着不同的缩进
    PodTest

=head2 SYNOPSIS
   It is used for test for perl POD module

=head3 DESCRIPTION
   This is only a test, and it does not do anything, 
   I will show you how to use the POD in perl script.

=over 用于列表

=item Foo()
   This function is used for Foo

=item Bar()
   This function is used for Bar

=back

=begin text  用于标记一段有特殊格式的文档,可以不遵循POD的语法

    ---------------
    |  aaa        |
    |        bbb  |
    ---------------
  ^^^^  smile ^^^^

=end text

=encoding utf8 编码格式

=cut

查看

perldoc podtest.pl

导出

pod2html podtest.pl > podtest.html
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容