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

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

=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`);即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章