What's the name of Perl distribution units?

Viewed 108

Package is a namespace. Module is a file with Perl code. cpan and cpanm are probably package managers. When I do cpanm XML::LibXML I install what exactly?

3 Answers

Distribution (or "dist" for short).

The name for a Perl distribution unit is distribution, so cpanm XML::LibXML installs the XML-LibXML distribution, because it includes the specified XML::LibXML module.

Example 1

Screenshot of meta::cpan using the word "distribution"

Example 2

Screenshot of meta::cpan using the word "distribution"

Note that linux distributions usually have a package manager such as apt or yum, and many Perl distributions are made available as packages for those package managers. Someone using those package managers might refer to Perl distributions as packages, but that's not standard Perl jargon.

When you download a package with a name like "UseFull::Munger"

You will at the very least get a file UseFull/Munger.pm installed in your perl library.

You could also get a set of modules used to implement the main module: "/UseFull/Munger/dyslexic.pm".

The module may be a wrapper around a C library (like LibXML) in which case you will get some binaries installed such as "auto/XML/LibXML/LibXML.so".

If cpan needs to build a wrapper for a library you will get some "UseFull/Munger/SlickClib/SlikClib.xs" files which tell CPAN how to build the perl wrapper.

In addition, if the developer is nice, you may get lots of ".pod" document ion on how to use the module.

I call these Perl modules or CPAN modules. The individual .pm building blocks are Perl modules too, but you rarely use them directly.

When talking about the archive file that you upload to CPAN, you can use the word distribution. When talking about all the other files that are in there and that you can view on metacpan, taking a look at the dist(ribution) works well, too.

Related