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
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容