Stephen
Stephen

Reputation: 8810

Why are some core Perl modules also available on CPAN?

For example I believe that the Encode module is considered a core module and shipped with every copy of Perl. It has its own page on Perldoc:

https://perldoc.perl.org/Encode.html

...but it is also available on CPAN:

http://search.cpan.org/~dankogai/Encode-2.92/Encode.pm

From skimming the two documents, it seems that they contain the same text. So why put it in both places? Is it just so that CPAN can be used to lookup documentation on "any Perl module"?

Upvotes: 3

Views: 161

Answers (2)

ikegami
ikegami

Reputation: 385976

Such modules are said to be "dual-life" modules.

  • So users can upgrade the module without upgrading perl itself.

  • So developers can release fixes and updates to the module on a different schedule (e.g. more often) than perl itself.

  • Or maybe the module started on CPAN, and it was later added to the perl distro (e.g. because a module in the tool chain requires it).

  • Or maybe the module is in the process of being removed from the Perl distro.

Upvotes: 8

A. Ferreira
A. Ferreira

Reputation: 31

Also making a core library available at CPAN allows to easily upgrade from the version shipped with Perl to get the latest improvements and bug fixes.

For example, Encode versions shipped with some versions of perl:

Perl      Encode
v5.22.4   2.72_01
v5.24.2   2.80_01
v5.26.1   2.88

(retrieved with corelist -a Encode). Any of these can be readily updated to the latest Encode 2.92.

Upvotes: 2

Related Questions