5

In the Perl world there is a great thing called CPAN. It is a big storage for open source Perl libraries.

I use modules from CPAN and I have released several distributions myself.

I use CPAN, but there is one essential thing that I don't understand. I don't know what words are used for the different things on CPAN. In the beginning of this post I have used the words libraries, modules, distributions, but I'm not sure that I have used them correctly.

Can you please explain what each of this words means in case of CPAN (if they can be used in the scope of CPAN):

  • module
  • package
  • release
  • distribution
  • library
RobEarl
  • 7,862
  • 6
  • 35
  • 50
bessarabov
  • 11,151
  • 10
  • 34
  • 59
  • Partial answer: http://stackoverflow.com/q/6376006/1030675 – choroba Sep 03 '13 at 13:36
  • 1
    @choroba, In that answer, I wasn't trying to define terms. I used the OP's definition of library, which is rarely what is meant by library. Still, it's probably great related reading. – ikegami Sep 03 '13 at 13:57

1 Answers1

15

All of these terms have "flexible" definitions, even in a Perl context. In a Perl context, they most commonly mean the following:

  • module

    A file providing functions to be called by other files or a class to be used by other files.

    It will have the .pm extension. It will have a package directive. It will usually be loaded using use. etc

    Example: XML/LibXML.pm

  • package

    A directive that instructs Perl into which namespace to place symbols. It's also used as a synonym for "namespace".

    Example: XML::LibXML

  • distribution

    A collection of modules including an installer. What is found on CPAN.

    Example: XML-LibXML

  • library

    Not part of Perl jargon, except perhaps when indicating a distribution provides an interface to a C library. In C, it refers to a collection of functions and symbols which can be accessed by other objects and executables.

    Example: libxml2

  • release

    A specific version of something.

    Example: XML-LibXML-2.0104.tar.gz

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • Thank you! So If I undestand you correctly this is how to call things: "There is a distribution Plack that has several modules including Plack::Builder module. The latest release of Plack is 1.0029" – bessarabov Sep 03 '13 at 14:09
  • distributions don't have to have modules; some have just scripts, or some could have just data, I suppose. And some exist just to make it easy to install multiple other distributions (their "dependencies"). – ysth Sep 03 '13 at 14:49
  • 1
    True, though CPAN doesn't handle distributions without module very well. (That's why scripts are released as pseudo-modules in the App:: namespace.) – ikegami Sep 03 '13 at 15:12