Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: The perl source directory structure

by afoken (Chancellor)
on Aug 16, 2022 at 12:31 UTC ( [id://11146163]=note: print w/replies, xml ) Need Help??


in reply to The perl source directory structure

Yes, it looks confusing. That's probably the legacy of a quarter century of development.

Update:

perlsource may have some clues:

Core modules

Modules shipped as part of the Perl core live in four subdirectories. Two of these directories contain modules that live in the core, and two contain modules that can also be released separately on CPAN. Modules which can be released on cpan are known as "dual-life" modules.

lib/
This directory contains pure-Perl modules which are only released as part of the core. This directory contains all of the modules and their tests, unlike other core modules.
ext/
Like lib/, this directory contains modules which are only released as part of the core. Unlike lib/, however, a module under ext/ generally has a CPAN-style directory- and file-layout and its own Makefile.PL. There is no expectation that a module under ext/ will work with earlier versions of Perl 5. Hence, such a module may take full advantage of syntactical and other improvements in Perl 5 blead.
dist/
This directory is for dual-life modules where the blead source is canonical. Note that some modules in this directory may not yet have been released separately on CPAN. Modules under dist/ should make an effort to work with earlier versions of Perl 5.
cpan/
This directory contains dual-life modules where the CPAN module is canonical. Do not patch these modules directly! Changes to these modules should be submitted to the maintainer of the CPAN module. Once those changes are applied and released, the new version of the module will be incorporated into the core.

For some dual-life modules, it has not yet been determined if the CPAN version or the blead source is canonical. Until that is done, those modules should be in cpan/.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: The perl source directory structure

Replies are listed 'Best First'.
Re^2: The perl source directory structure
by ikegami (Patriarch) on Aug 16, 2022 at 21:11 UTC

    The use of Makefile.PL in ext/[1] provides a well-established way to instruct how to build them. This is why modules with binary components are in ext/ and not lib/.


    1. This is what was called "CPAN-like", but isn't really because the directories here don't have any of the other files that CPAN wants.

Re^2: The perl source directory structure
by syphilis (Archbishop) on Aug 17, 2022 at 03:32 UTC
    perlsource may have some clues

    Thanks afoken ... that's what I needed to read.

    I was being thrown by the fact that the dual-life module threads, located in the "dist" directory of the perl source, is currently at version 2.28 (2.27 in perl-5.36.0 source), yet CPAN stops at version 2.21 (from Jan 2018).
    But it turns out this is totally allowable under the perlsource spec for files located in the "dist" directory ... though I'm going to have a serious rethink about the meaning of "dual-life".
    If a "dual-life" module is going to remain at version 2.21 on CPAN forever more (either in order to remain backwards-compatible, or because no-one can be bothered updating the CPAN version), is it really "dual-life" ? What sort of a "dual" life is that ?
    To quote InfiniteSilence: "Might want to ask the Perl Porters that question" ;-)

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11146163]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-23 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found