Structuring documents with sections
Documents are structured with =headN
(N = 1 … 4)
=head1 Title
Some text.
More text
# code is indented by 4 spaces
my $foo = 'bar';
=cut
Note: the empty line after =headN seems important.
recommended order of sections
The recommended order of sections (
=head1
) in a
Perl module is:
- NAME
- SYNOPSIS
- DESCRIPTION (of module)
- Description of methods in module
- BUGS/CAVEATS
- AUTHOR
- SEE ALSO
- COPYRIGHT and LICENSE
Items
=over indent-level
=item * foo
Optional text for item foo
=item * bar
Optional text for item bar
=item * baz
=back
The optional number indent-level
specifies how far (in M
s) the text should be indented. Can be ignored.
Formatting text
I<italic>, B<bold>, C<code>, E<lt>, E<gt>, E<verbar>, E<sol>,
F<filename.txt> S<text with no breaking spaces>
Formatting text that contains <
or >
is possible using double brackets: << … >>
:
<< if (a < b) >>
Note: the space after <<
and before >>
is ignored.