Pod::ParseLink (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
Pod::ParseLink - Parse an L<> formatting code in POD textSYNOPSIS
use Pod::ParseLink; my ($text, $inferred, $name, $section, $type) = parselink ($link);
DESCRIPTION
This module only provides a single function, parselink(), which takes the text of an L<> formatting code and parses it. It returns the anchor text for the link (if any was given), the anchor text possibly inferred from the name and section, the name orParsing is implemented per perlpodspec. For backward compatibility, links where there is no section and name contains spaces, or links where the entirety of the link (except for the anchor text if given) is enclosed in double-quotes are interpreted as links to a section (L</section>).
The inferred anchor text is implemented per perlpodspec:
L<name> => L<name|name> L</section> => L<"section"|/section> L<name/section> => L<"section" in name|name/section>
The name may contain embedded E<> and Z<> formatting codes, and the section, anchor text, and inferred anchor text may contain any formatting codes. Any double quotes around the section are removed as part of the parsing, as is any leading or trailing whitespace.
If the text of the L<> escape is entirely enclosed in double quotes, it's interpreted as a link to a section for backward compatibility.
No attempt is made to resolve formatting codes. This must be done after calling parselink() (since E<> formatting codes can be used to escape characters that would otherwise be significant to the parser and resolving them before parsing would result in an incorrect parse of a formatting code like:
L<verticalE<verbar>barE<sol>slash>
which should be interpreted as a link to the "vertical|bar/slash"
SEE ALSO
Pod::ParserThe current version of this module is always available from its web site at <www.eyrie.org/~eagle/software/podlators>.
AUTHOR
Russ Allbery <rra@stanford.edu>.COPYRIGHT AND LICENSE
Copyright 2001, 2008, 2009 Russ Allbery <rra@stanford.edu>.This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.