in reply to Re^2: Any reason to have documentation-only *.pm file instead of *.pod for CPAN distro?
in thread Any reason to have documentation-only *.pm file instead of *.pod for CPAN distro?

the directory Core exists in MCE's distribution

https://metacpan.org/release/MARIOROY/MCE-1.900/source/lib/MCE/Core

> So... someone evil can hijack the namespace?

So, no I don't think so.

But this probably also depends on the correct META settings of the distribution (???)

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

  • Comment on Re^3: Any reason to have documentation-only *.pm file instead of *.pod for CPAN distro?
  • Download Code

Replies are listed 'Best First'.
Re^4: Any reason to have documentation-only *.pm file instead of *.pod for CPAN distro?
by Haarg (Priest) on Jan 03, 2025 at 19:49 UTC

    The existence of a directory doesn't matter at all to how things are indexed. And subdirectories (or sub-packages) don't imply any relationship between namespaces. Claiming the package MCE::Core::Worker doesn't give you permissions on MCE::Core.

    Until the latest release, there was no MCE::Core package, only a .pod file. So it was not indexed, and had no permissions attached to it. It would have been possible for a bad actor to claim that namespace and upload any tarball they wanted for it.

    It is possible to control this through data in a META.json file, but usually that data is automatically generated. And it can still be confusing for a dist to claim it provides a module that doesn't actually exist because it's only a .pod file.

      I'm new to POD and pod/pm interaction and precedence, please forgive my silly questions. I've just created Acme::AAA "distribution" tarball where I also included Cwd.pod to "hijack" a core module documentation. Then cpanm'd this tarball, checked with perldoc Cwd, and it printed "evil" content of my POD, not documentation extracted from Cwd.pm. Apart from, apparently, nothing prevents a "bad actor" to lure people to install something similar, but if uploaded to CPAN, what the https://metacpan.org/pod/Cwd would display then "globally"?

      While we are at it, looks like perldoc link in SEE ALSO section of perlpod and elsewhere is broken in effect, it shows some obsolete Spanish translation.