. For example,
=begin html
This is a raw HTML paragraph
=end html
The command "=for I I"
specifies that the remainder of just this paragraph (starting
right after I) is in that special format.
=for html
This is a raw HTML paragraph
This means the same thing as the above "=begin html" ... "=end html"
region.
That is, with "=for", you can have only one paragraph's worth
of text (i.e., the text in "=foo targetname text..."), but with
"=begin targetname" ... "=end targetname", you can have any amount
of stuff in between. (Note that there still must be a blank line
after the "=begin" command and a blank line before the "=end"
command.)
Here are some examples of how to use these:
=begin html
Figure 1.

=end html
=begin text
---------------
| foo |
| bar |
---------------
^^^^ Figure 1. ^^^^
=end text
Some format names that formatters currently are known to accept
include "roff", "man", "latex", "tex", "text", and "html". (Some
formatters will treat some of these as synonyms.)
A format name of "comment" is common for just making notes (presumably
to yourself) that won't appear in any formatted version of the Pod
document:
=for comment
Make sure that all the available options are documented!
Some I will require a leading colon (as in
C<"=for :formatname">, or
C<"=begin :formatname" ... "=end :formatname">),
to signal that the text is not raw data, but instead I Pod text
(i.e., possibly containing formatting codes) that's just not for
normal formatting (e.g., may not be a normal-use paragraph, but might
be for formatting as a footnote).
=item C<=encoding I>
X<=encoding> X
This command is used for declaring the encoding of a document. Most
users won't need this; but if your encoding isn't US-ASCII,
then put a C<=encoding I> command very early in the document so
that pod formatters will know how to decode the document. For
I, use a name recognized by the L
module. Some pod formatters may try to guess between a Latin-1 or
CP-1252 versus
UTF-8 encoding, but they may guess wrong. It's best to be explicit if
you use anything besides strict ASCII. Examples:
=encoding latin1
=encoding utf8
=encoding koi8-r
=encoding ShiftJIS
=encoding big5
C<=encoding> affects the whole document, and must occur only once.
=back
And don't forget, all commands but C<=encoding> last up
until the end of its I, not its line. So in the
examples below, you can see that every command needs the blank
line after it, to end its paragraph. (And some older Pod translators
may require the C<=encoding> line to have a following blank line as
well, even though it should be legal to omit.)
Some examples of lists include:
=over
=item *
First item
=item *
Second item
=back
=over
=item Foo()
Description of Foo function
=item Bar()
Description of Bar function
=back
=head2 Formatting Codes
X X
X X
In ordinary paragraphs and in some command paragraphs, various
formatting codes (a.k.a. "interior sequences") can be used:
=for comment
"interior sequences" is such an opaque term.
Prefer "formatting codes" instead.
=over
=item CtextE> -- italic text
X X<< IZ<><> >> X X
Used for emphasis ("Ccareful!E>") and parameters
("CLABELE>")
=item CtextE> -- bold text
X X<< BZ<><> >> X X
Used for switches ("C-nE switch>"), programs
("CchfnE for that>"),
emphasis ("Ccareful!E>"), and so on
("CautovivificationE>").
=item CcodeE> -- code text
X X<< CZ<><> >> X X
Renders code in a typewriter font, or gives some other indication that
this represents program text ("Cgmtime($^T)E>") or some other
form of computerese ("Cdrwxr-xr-xE>").
=item CnameE> -- a hyperlink
X X<< LZ<><> >> X X
There are various syntaxes, listed below. In the syntaxes given,
C, C, and C cannot contain the characters
'/' and '|'; and any '<' or '>' should be matched.
=over
=item *
CnameE>
Link to a Perl manual page (e.g., CNet::PingE>). Note
that C should not contain spaces. This syntax
is also occasionally used for references to Unix man pages, as in
Ccrontab(5)E>.
=item *
Cname/"sec"E> or Cname/secE>
Link to a section in other manual page. E.g.,
Cperlsyn/"For Loops"E>
=item *
C/"sec"E> or C/secE>
Link to a section in this manual page. E.g.,
C/"Object Methods"E>
=back
A section is started by the named heading or item. For
example, Cperlvar/$.E> or Cperlvar/"$."E> both
link to the section started by "C<=item $.>" in perlvar. And
Cperlsyn/For LoopsE> or Cperlsyn/"For Loops"E>
both link to the section started by "C<=head2 For Loops>"
in perlsyn.
To control what text is used for display, you
use "Ctext|...E>", as in:
=over
=item *
Ctext|nameE>
Link this text to that manual page. E.g.,
CPerl Error Messages|perldiagE>
=item *
Ctext|name/"sec"E> or Ctext|name/secE>
Link this text to that section in that manual page. E.g.,
Cpostfix "if"|perlsyn/"Statement Modifiers"E>
=item *
Ctext|/"sec"E> or Ctext|/secE>
or Ctext|"sec"E>
Link this text to that section in this manual page. E.g.,
Cthe various attributes|/"Member Data"E>
=back
Or you can link to a web page:
=over
=item *
Cscheme:...E>
Ctext|scheme:...E>
Links to an absolute URL. For example, Chttp://www.perl.org/E> or
CThe Perl Home Page|http://www.perl.org/E>.
=back
=item CescapeE> -- a character escape
X X<< EZ<><> >> X X
Very similar to HTML/XML C<&I;> "entity references":
=over
=item *
CltE> -- a literal E (less than)
=item *
CgtE> -- a literal E (greater than)
=item *
CverbarE> -- a literal | (Itical I)
=item *
CsolE> -- a literal / (Iidus)
The above four are optional except in other formatting codes,
notably C...E>, and when preceded by a
capital letter.
=item *
ChtmlnameE>
Some non-numeric HTML entity name, such as CeacuteE>,
meaning the same thing as C<é> in HTML -- i.e., a lowercase
e with an acute (/-shaped) accent.
=item *
CnumberE>
The ASCII/Latin-1/Unicode character with that number. A
leading "0x" means that I is hex, as in
C0x201EE>. A leading "0" means that I is octal,
as in C075E>. Otherwise I is interpreted as being
in decimal, as in C181E>.
Note that older Pod formatters might not recognize octal or
hex numeric escapes, and that many formatters cannot reliably
render characters above 255. (Some formatters may even have
to use compromised renderings of Latin-1/CP-1252 characters, like
rendering CeacuteE> as just a plain "e".)
=back
=item CfilenameE> -- used for filenames
X X<< FZ<><> >> X X
Typically displayed in italics. Example: "C.cshrcE>"
=item CtextE> -- text contains non-breaking spaces
X X<< SZ<><> >> X
X
This means that the words in I should not be broken
across lines. Example: S$x ? $y : $zE>>.
=item Ctopic nameE> -- an index entry
X X<< XZ<><> >> X X
This is ignored by most formatters, but some may use it for building
indexes. It always renders as empty-string.
Example: Cabsolutizing relative URLsE>
=item CE> -- a null (zero-effect) formatting code
X X<< ZZ<><> >> X X
This is rarely used. It's one way to get around using an
EE...E code sometimes. For example, instead of
"CltE3>" (for "NE3") you could write
"CEE3>" (the "ZEE" breaks up the "N" and
the "E" so they can't be considered
the part of a (fictitious) "NE...E" code).
Another use is to indicate that I in C<=item ZEEI>
is not to be considered to be a bullet or number. For example,
without the CE>, the line
=item Z<>500 Server error
could possibly be parsed as an item in a numbered list when it isn't
meant to be.
Still another use is to maintain visual space between C<=item> lines.
If you specify
=item foo
=item bar
it will typically get rendered as
foo
bar
That may be what you want, but if what you really want is
foo
bar
you can use CE> to accomplish that
=item foo
Z<>
=item bar
=for comment
This was formerly explained as a "zero-width character". But it in
most parser models, it parses to nothing at all, as opposed to parsing
as if it were a E or E, which are REAL zero-width characters.
So "width" and "character" are exactly the wrong words.
=back
Most of the time, you will need only a single set of angle brackets to
delimit the beginning and end of formatting codes. However,
sometimes you will want to put a real right angle bracket (a
greater-than sign, '>') inside of a formatting code. This is particularly
common when using a formatting code to provide a different font-type for a
snippet of code. As with all things in Perl, there is more than
one way to do it. One way is to simply escape the closing bracket
using an C code:
C<$a E