What is the difference between module and distribution on CPAN?
cpan, perl
Solution
A distribution will contain one or more modules, documentation, a build script, and also typically a test suite, a file manifest, readme, change log, and license information. Modules bundled together in a distribution are often part of complete class library, or at the very least all related tools divided into intuitively-named packages.
Taking, for example, the core IO distribution, you can see it contains the following modules:
- IO - load various IO modules
- IO::Dir - supply object methods for directory handles
- IO::File - supply object methods for filehandles
- IO::Handle - supply object methods for I/O handles
- IO::Pipe - supply object methods for pipes
- IO::Poll - Object interface to system poll call
- IO::Seekable - supply seek based methods for I/O objects
- IO::Select - OO interface to the select system call
- IO::Socket - Object interface to socket communications
- IO::Socket::INET - Object interface for AF_INET domain sockets
- IO::Socket::UNIX - Object interface for AF_UNIX domain sockets
Problem
I was just comparing the numbers if different "Archive Networks", like CPAN, CTAN, rubygems.org etc. CPAN displays two very different numbers: - 105,774 modules - 24,657 distributions As I'm not a Perl programmer (I'm just preparing a talk for university), I'm not familiar with Perl's wording. I tried to look them up and only found "module" to be defined by Perl itself. As far as I understood it, a module is any file with a namespace. However, I can't find any declarations of what a distribution is. Even CPAN only shows a list of modules or they use both words together (as "module distribution"). Can anyone clear my mind?