perl pod文檔使用 =head =cut =pod pod2text 實現程式usage說明

來源:互聯網
上載者:User

=head1 NAME

The name of your program or module.

 

=head1 SYNOPSIS

A one-line description of what your program or module does (purportedly).

 

=head1 DESCRIPTION

The bulk of your documentation. (Bulk is good in this context.)

 

=head1 AUTHOR

Who you are. (Or an alias, if you are ashamed of your program.)

 

=head1 BUGS

What you did wrong (and why it wasn’t really your fault).

 

=head1 SEE ALSO

Where people can find related information (so they can work around your bugs).

 

=head1 COPYRIGHT

The copyright statement. If you wish to assert an explicit copyright, you should say something like:

Copyright 2013, Randy Waterhouse.  All Rights Reserved.

 

注意:每個=標籤上下必須隔一行,否則就會錯誤解析。

=for html   或者 =for text

是把下面的單行注視當作html或者text來處理,與其功能類似的是 =begin html  / =end html    ;   =begin text /  =end text   兩對。begin和end之間可以處理多行。

 

=over  4

=item  SOMEWORD

 

  *************

 

=item somewordelse

 

******

 

=back

以上寫法是寫一個列表,以over開頭,後面的數字是列表中每行的縮排量。最後以=back 結尾。

=cut    是結束pod塊的標誌,與程式分開。

 

在perl中,可以使用 pod2html  **.pm  >**.html 來產生html格式的pod文檔。

 

=pod =cut既可以作為程式多行注釋,又可以實現程式usage說明,利用pod2text命令。die (`pod2text $0`);即可

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.