Basic usage of pods in Perl.

Source: Internet
Author: User

1. Pod syntax

Pod can be divided into three kinds, ordinary paragraph, literal paragraph (verbatim Paragraph) and command paragraph.
The distinction between the three is very simple, to =pod|head1|cut|over, such as the beginning of the paragraph as a command paragraph, with a space or tab (\ t), such as indentation to start the paragraph as a literal paragraph, the rest is the ordinary paragraph.

[PHP]View PlainCopy
    1. =head1
    2. =head2
    3. =head3
    4. =head4
    5. This four indicator words produce the title of the specified level. Pod2html with its corresponding

[Plain]View PlainCopy
    1. =pod
    2. =cut
    3. =pod only tells the compiler that the pod document is starting, and =cut is the end of the pod document.

[Plain]View PlainCopy
    1. =over number Close
    2. =item SYMBOL Generation Bullet
    3. =back
    4. The three of them are connected together. =over must be followed by a =back, and there is at least one =item between the two, and there can be no =head1. 4.

[Plain]View PlainCopy
    1. Format code
    2. The format code can be used for all paragraphs except the literal paragraph, including the command paragraph.
    3. I<text>
    4. Text in italics, effect as text
    5. B<text>
    6. Text in bold, effect as text
    7. C<code>
    8. Pod2html with <code> surround.
    9. L<text|name/sec>
    10. Hyperlinks.

2. Use of Pod2usage in the package.

If you want to display pods in the Perl module, use the following

[Plain]View PlainCopy
    1. Use Pod::find QW (pod_where);
    2. Pod2usage (-input = Pod_where ({-inc = 1}, __package__));
    3. Where:-inc=>1 means Search @INC for the pod and also the Scriptdir __package__ represents the package file, if it is a::b A/b
    4. Pod_where returns a reference to the file handle, and the default value in Pod2usage is $ $, the current file instead of the package itself

Basic usage of pods in Perl.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.