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

Say there's a module on CPAN with the following layout:
Makefile.PL lib/Foo.pm eg/example.pl ...
Is there a way to link from the POD in lib/Foo.pm to the source of the script in eg/example.pl?

Seems like there's no way via a L<...> link (or is there?) and using a =for html directive to fix the HTML-formatted docs on sites like search.cpan.org is somewhat hacky. Any other ideas?

Replies are listed 'Best First'.
Re: POD link to example script in module distribution?
by PodMaster (Abbot) on Aug 24, 2005 at 00:38 UTC
    No, that stuff doesn't get installed, so you can't link to it. What you should use is F<eg/example.pl>.

    For example,

    You can browse the eg/ directory online from the [Browse] link on the http://search.cpan.org/~gaas/HTML-Parser/ page.

    You could also persuade the maintainer of search.cpan.org (and cpan.uwinnipeg.ca) to turn F<eg/example.pl> into the appropriate link.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      No, that stuff doesn't get installed, so you can't link to it.
      Just curious: What if it does get installed via EXE_FILES => ['eg/example.pl'], in Makefile.PL?
        See 'perldoc perlpod' and 'perldoc perlpodspec', but basically L<example> althrough that would be a poor thing to end up in a perl bin directory.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.