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

When reading documentation on metacpan.org, I frequently see stuff like this:
# Default is C<0>
or
# returns a L<Net::Amazon::S3::Client::Bucket> object
What does the "C" and "L" stand for?

Replies are listed 'Best First'.
Re: Unknown tags in documentation
by LanX (Saint) on Dec 10, 2021 at 03:13 UTC
    it's documented in perlpod

    • C<code> -- code text
    • L<name> -- a hyperlink

    > When reading documentation on metacpan.org, I frequently see stuff like this:

    Documentation on metacpan.org is usually HTML not raw POD, you must walk detours to see that.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      The code snippets show perl comments, not pod. Maybe the answer here is that some authors get so used to pod formatting that they include it in their regular comments as well, or maybe in comments within the POD code blocks as an accidental side effect of search/replace?
        Good point, I intuitively assumed the OP added the # on his own.

        But - as so often - it would be best if he gave us a link to where he "frequently saw stuff like" that.

        Better than us speculating...

        BTW: another option could be that the author is post processing the comments to generate POD and/or other docs.

        The examples given look a lot like API docs, like the ones shown in IDE pop-ups.

        But that's aforementioned speculation and I doubt this is "frequently seen" ...

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Re: Unknown tags in documentation
by kcott (Archbishop) on Dec 11, 2021 at 02:25 UTC

    G'day fkento,

    The short answer is that these represent author errors.

    Take a look at perlpod. Near the start you'll see a description of both an "Ordinary Paragraph" and a "Verbatim Paragraph". Note that the former allows formatting codes but the latter does not.

    About halfway down that page, you'll find "Formatting Codes". Here you'll see an explanation of "C<code> -- code text", "L<name> -- a hyperlink", and many others.

    Now look at the "source code for Net::Amazon::S3::Client", you'll see at both lines 153 and 161:

    # returns a L<Net::Amazon::S3::Client::Bucket> object

    Because those lines, and the lines around them, start with whitespace, they form a verbatim paragraph. Formatting codes are not allowed in verbatim paragraphs, so the "L<...>" is rendered exactly as seen.

    I'm not going to go hunting for examples of C<0>. Look in the source code of wherever you saw this: I expect you'll find the same "formatting code within a verbatim paragraph" error.

    "When reading documentation on metacpan.org, I frequently see stuff like this:"

    I've read a lot of CPAN documentation and I can't remember seeing this in the past (certainly not frequently). I did note that the "Net-Amazon-S3 distribution" has many modules with the same error. I've never used any modules in the Net::Amazon:: namespace, so I don't know how widespread this problem is. I'd be interested to know if you've encountered this issue with other, unrelated modules.

    — Ken

Re: Unknown tags in documentation
by Anonymous Monk on Dec 10, 2021 at 03:16 UTC