What is the difference between module and CPAN distribution?

I just compared numbers if different "archive networks" like CPAN, CTAN, rubygems.org, etc. CPAN displays two very different numbers:

  • 105 774 modules
  • 24,657 distributions

Since I'm not a Perl programmer (I'm just preparing a conversation for the university), I am not familiar with the Perl wording. I tried to find them and found only a “module” that should be defined by Perl itself. As I understand it, a module is any file with a namespace.

However, I cannot find any announcements about what the distribution is. Even CPAN only shows a list of modules or uses both words together (like "distribution of modules"). Can anyone clear my mind?

+6
source share
1 answer

The distribution will contain one or more modules, documentation, a script assembly, and also, as a rule, a test suite, a file manifest, readme, a change log, and license information. The modules included in the distribution are often part of a complete library of classes, or at least all related tools, divided into intuitively named packages.

Taking, for example, the main IO distribution, you can see that it contains the following modules:

  • IO - loading various input / output modules
  • IO :: Dir - delivery object methods for directory descriptors
  • IO :: File - delivery object methods for file descriptors
  • IO :: Handle - delivery object methods for I / O pens
  • IO :: Pipe - supply methods for pipes
  • IO :: Poll - object interface for calling a system poll
  • IO :: Seekable - Search-based search methods for I / O objects
  • IO :: Select - OO interface for selecting a system call
  • IO :: Socket - object interface for socket communication
  • IO :: Socket :: INET - object interface for domain sockets AF_INET
  • IO :: Socket :: UNIX - Object Interface for AF_UNIX Domain Sockets
+15
source

Source: https://habr.com/ru/post/913367/


All Articles