syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
At http://search.cpan.org/~sisyphus/Inline-0.45/C/C.pod in the section "DESCRIPTION" (near the beginning, though you might have to scroll down a couple of inches to see it) there's a link to "Inline::C-Cookbook" at the (non-existent) location of http://search.cpan.org/perldoc?Inline%3A%3AC-Cookbook. If I understand correctly, that incorrect link is being rendered from L<Inline::C-Cookbook> in the C.pod file.

With what should the "L<Inline::C-Cookbook>" be replaced in order to have the link correctly rendered ? (The correct location is http://search.cpan.org/~sisyphus/Inline-0.45/C/C-Cookbook.pod ).

Where do I find the documentation that explains the rules regarding CPAN's rendering of POD links ?

Cheers,
Rob

Replies are listed 'Best First'.
Re: CPAN's rendering of POD links
by tilly (Archbishop) on Jan 01, 2009 at 12:23 UTC
    If I get rid of the -Cookbook, the link works perfectly well to take you to Inline::C. The %3A%3A is just a URI-encoding of ::. Therefore I don't think there is a problem with the way the link was generated from POD. Instead I suspect that the problem is that search.cpan.org expects to be showing links to things that could be valid Perl module names. The - in your URL can't be a valid Perl module name. As confirmation, searching for Inline::C-Cookbook doesn't turn up your file.

    Change the name of the file and link to Inline::C_Cookbook and everything should work just fine.

        I'm not sure if its ever explicitly stated in any docs, but the NAME part before - is used for linking

        I was unaware of any of that. I think I can see what you're getting at. I'm a little puzzled as to how that "Inline::C-Cookbook" in the "NAME" is going to convey the information that the file is actually in the "C" directory (rather than the top-level directory ... or even the non-existent "C-Cookbook" directory).

        I'll give it a go, next release.

        Cheers,
        Rob
        Fascinating. I'm sure this is a bug.

        If you look in, say, Rose::DB you'll see that they use 2 different kinds of links. The first is for ones in the uploaded distribution. The second is for ones which are in some other distribution. In that distribution it gets them right. The problem is that you are getting the "not my distribution" type of link for Inline::C-Cookbook, and it isn't working. Your good links are of the direct kind. I don't see an option for having 2 kinds of links in Pod::Html, so they are probably using some kind of custom parser (possibly derived from that one).

        (Possibly related is that in perl 5.8 if I type in pod2html Inline.pod > foo.html I see 5 warnings about being unable to resolve links. It is unable to resolve Inline-Support (2x), Inline-API (2x) and Inline-FAQ (1x). It does think it can resolve Inline::C-Cookbook. The difference is in the function page_sect in Pod::Html. It has conditional logic with a branch for /::/ that has different logic than the final else. If they hacked up that to get theirs, then this might be related. Or could just be coincidence.)

        So at this point I am confident that this is a bug. http://search.cpan.org/feedback has advice for how to give feedback. I'd use that to report the bug. In the meantime my original suggestion for renaming the file probably will succeed in working around their bug.