In Perl, POD (Plain Old Documentation) documents can be embedded in modules or scripts.
POD is a simple and easy-to-use markup language (markup language).
POD document usage rules:
The POD document starts with =head1 and ends with =cut . Add a blank line before =head1 and after =cut .
Perl ignores documentation in PODs. Examples are as follows:
Executing the above program, the output result is:
Hello, WorldHello, Codercto
We can also use "__END__" or "__DATA__" to "comment" out all the content after the line:
Executing the above program, the output result is:
Hello, World=head1 Hello, World Example This is a simple Perl example. print "Hello, Codercton";
The following example does not read the POD document:
Executing the above program, the output result is:
Hello, World
Pod (Plain Old Documentation) is a simple and easy-to-use markup language (markup language), which is often used for document writing in perl programs and modules.
The Pod converter can convert Pod into many formats, such as text, html, man, etc.
The Pod markup language contains three basic basic types: normal, textual, and command.
Ordinary paragraphs : You can use formatting codes in ordinary paragraphs, such as bold, italics, or code style, underlining, etc.
Original paragraph : Original paragraph, used for code blocks or other parts that do not require converter processing, and do not require paragraph rearrangement.
Command paragraph : Command paragraphs act on the entire document and are usually used for title setting or list markup.
All command paragraphs (which are only one line long) begin with "=", followed by an identifier. Subsequent text will be affected by this command. Now widely used commands include
=pod (start document)=head1 title text=head2 title text=head3 title text=head4 title text=over number of indented spaces=item prefix=back (end list)=begin document format=end end document format=for format text =encoding encoding type=cut (end of document)
In perl, you can use pod2html **.pod >**.html to generate pod documents in html format.
Consider the following POD instance:
When pod2html is used, this code will be copied from the original text.
Use the pod2html command to execute and convert it to HTML code:
$ pod2html test.pod > test.html
Open test.html in the browser, the link part is the index, as shown below:
The following example writes HTML directly in the POD document:
=begin html=encoding utf-8<h1>Coder Tutorial</h1><p> www.codercto.com </p>=end html
When pod2html is used, this code will be copied from the original text.
Use the pod2html command to execute and convert it to HTML code:
$ pod2html test.pod > test.html
Open test.html in the browser, the link part is the index, as shown below: