MAN page from PCLinuxOS perl-podlators-4.70.0-3pclos2017.noarch.rpm
Section: User Contributed Perl Documentation (3)
Pod::ParseLink - Parse an L<> formatting code in POD text
use Pod::ParseLink; my $link = get_link(); my ($text, $inferred, $name, $section, $type) = parselink($link);
This module only provides a single function, parselink()
, which takes thetext of an L<> formatting code and parses it. It returns theanchor text for the link (if any was given), the anchor text possiblyinferred from the name and section, the name or URL,
the section if any,and the type of link. The type will be one of "url"
, or "man"
,indicating a URL,
a link to a POD
page, or a link to a Unix manual page.
Parsing is implemented per perlpodspec. For backward compatibility,links where there is no section and name contains spaces, or links where theentirety of the link (except for the anchor text if given) is enclosed indouble-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 anyformatting codes. Any double quotes around the section are removed as partof the parsing, as is any leading or trailing whitespace.
If the text of the L<> escape is entirely enclosed in doublequotes, it's interpreted as a link to a section for backwardcompatibility.
No attempt is made to resolve formatting codes. This must be done aftercalling parselink() (since E<> formatting codes can be used toescape characters that would otherwise be significant to the parser andresolving them before parsing would result in an incorrect parse of aformatting code like:
which should be interpreted as a link to the "vertical|bar/slash" POD pageand not as a link to the "slash" section of the "bar" POD page with ananchor text of "vertical". Note that not only the anchor text will need tohave formatting codes expanded, but so will the target of the link (to dealwith E<> and Z<> formatting codes), and special handling ofthe section may be necessary depending on whether the translator wants toconsider markup in sections to be significant when resolving links. Seeperlpodspec for more information.
The current version of this module is always available from its web site at<http://www.eyrie.org/~eagle/software/podlators/>.
Russ Allbery <rraAATTcpan.org>.
COPYRIGHT AND LICENSE
Copyright 2001, 2008, 2009 Russ Allbery <rraAATTcpan.org>.
This program is free software; you may redistribute it and/or modify itunder the same terms as Perl itself.
- SEE ALSO
- COPYRIGHT AND LICENSE
This document was created byman2html,using the manual pages.