Home > Net >  In Perl POD, what is the proper way to link to an internal function?
In Perl POD, what is the proper way to link to an internal function?

Time:10-26

The perlpod documentation says you can L<link to something> but it does not indicate the proper way to reference a Perl-core function (or if it does, it wasn't obvious to me).

Specifically, I want to link to what is shown by perldoc -f wantarray. What is the proper way to L<...> link to it so it will take you to the wantarray documentation when you click on the link from MetaCPAN and other POD viewers that follow links?

(Note that wantarray is just a built-in Perl function like print or open.)

CodePudding user response:

One way is to use the full URL to the wantarray function:

L<wantarray|https://perldoc.perl.org/functions/wantarray>

There does not seem to be a special way to link to a built-in function using L<>


The above works and you can easily try it out on the metacpan POD Renderer

CodePudding user response:

The best I could find is to bring up the manual pages (perldoc) on CPAN

L<perlfunc/wantarray>

L<File::Find>

L<perlop>

L<perlsyn/"For Loops">

These bring up pages on CPAN: wantarray, File::Find, perlop, and "For Loops" in perlsyn. They are all linked on their respective perldoc pages and seem to be exactly the same. To give them names use L<wantarray|perlfunc/wantarray>, but try it as it stands first.

Find the syntax for (possible) other kinds of pages by finding them on perldoc and using the link "CPAN" on top of their page.

These are tested and processed as described using CPAN's POD renderer (pod2html) since the question is about CPAN content.


Btw, UNIX man pages work right out of docs:

L<crontab(5)>

This brings up http://man.he.net/man5/crontab

  • Related