Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl CPAN dictionary

Tags:

perl

cpan

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
like image 694
bessarabov Avatar asked Sep 03 '13 13:09

bessarabov


1 Answers

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

like image 66
ikegami Avatar answered Sep 30 '22 19:09

ikegami