Module::CoreList - what modules shipped with versions of perl |
Module::CoreList - what modules shipped with versions of perl
use Module::CoreList;
print $Module::CoreList::version{5.00503}{CPAN}; # prints 1.48
print Module::CoreList->first_release('File::Spec'); # prints 5.00405
print Module::CoreList->first_release_by_date('File::Spec'); # prints 5.005
print Module::CoreList->first_release('File::Spec', 0.82); # prints 5.006001
if (Module::CoreList::is_core('File::Spec')) { print "File::Spec is a core module\n"; }
print join ', ', Module::CoreList->find_modules(qr/Data/); # prints 'Data::Dumper' print join ', ', Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008); # prints 'Test::Harness::Assert, Test::Harness::Straps'
print join ", ", @{ $Module::CoreList::families{5.005} }; # prints "5.005, 5.00503, 5.00504"
Module::CoreList provides information on which core and dual-life modules shipped with each version of the perl manpage.
It provides a number of mechanisms for querying this information.
There is a utility called corelist provided with this module which is a convenient way of querying from the command-line.
There is a functional programming API available for programmers to query information.
Programmers may also query the contained hash structures to find relevant information.
These are the functions that are available, they may either be called as functions or class methods:
Module::CoreList::first_release('File::Spec'); # as a function
Module::CoreList->first_release('File::Spec'); # class method
first_release( MODULE )
Requires a MODULE name as an argument, returns the perl version when that module first appeared in core as ordered by perl version number or undef ( in scalar context ) or an empty list ( in list context ) if that module is not in core.
first_release_by_date( MODULE )
find_modules( REGEX, [ LIST OF PERLS ] )
find_version( PERL_VERSION )
undef
otherwise.
is_core( MODULE, [ MODULE_VERSION, [ PERL_VERSION ] ] )
Returns true if MODULE was bundled with the specified version of Perl.
You can optionally specify a minimum version of the module,
and can also specify a version of Perl.
If a version of Perl isn't specified,
is_core()
will use the numeric version of Perl that is running (ie $]
).
If you want to specify the version of Perl, but don't care about
the version of the module, pass undef
for the module version:
is_deprecated( MODULE, PERL_VERSION )
Returns true if MODULE is marked as deprecated in PERL_VERSION. If PERL_VERSION is omitted, it defaults to the current version of Perl.
deprecated_in( MODULE )
Returns the first perl version where the MODULE was marked as deprecated. Returns undef
if the MODULE has not been marked as deprecated.
removed_from( MODULE )
Takes a module name as an argument, returns the first perl version where that module was removed from core. Returns undef if the given module was never in core or remains in core.
removed_from_by_date( MODULE )
Takes a module name as an argument, returns the first perl version by release date where that module was removed from core. Returns undef if the given module was never in core or remains in core.
changes_between( PERL_VERSION, PERL_VERSION )
Given two perl versions, this returns a list of pairs describing the changes in
core module content between them. The list is suitable for storing in a hash.
The keys are library names and the values are hashrefs. Each hashref has an
entry for one or both of left
and right
, giving the versions of the
library in each of the left and right perl distributions.
For example, it might return these data (among others) for the difference between 5.008000 and 5.008001:
'Pod::ParseLink' => { left => '1.05', right => '1.06' }, 'Pod::ParseUtils' => { left => '0.22', right => '0.3' }, 'Pod::Perldoc' => { right => '3.10' }, 'Pod::Perldoc::BaseTo' => { right => undef },
This shows us two libraries being updated and two being added, one of which has an undefined version in the right-hand side version.
These are the hash data structures that are available:
%Module::CoreList::version
Note, it is possible for the version of a module to be unspecified,
whereby the value is undef
, so use exists $version{$foo}{$bar}
if
that's what you're testing for.
Starting with 2.10, the special module name Unicode
refers to the version of
the Unicode Character Database bundled with Perl.
%Module::CoreList::delta
It is a hash of hashes that is keyed on perl version. Each keyed hash will have the following keys:
delta_from - a previous perl version that the changes are based on changed - a hash of module/versions that have changed removed - a hash of modules that have been removed
%Module::CoreList::released
%Module::CoreList::families
%Module::CoreList::deprecated
%Module::CoreList::upstream
UPSTREAM indicates where patches should go. undef
implies
that this hasn't been discussed for the module at hand.
blead
indicates that the copy of the module in the blead
sources is to be considered canonical, cpan
means that the
module on CPAN is to be patched first. first-come
means
that blead can be patched freely if it is in sync with the
latest release on CPAN.
%Module::CoreList::bug_tracker
BUGS is an email or url to post bug reports. For modules with UPSTREAM => 'blead', use perl5-porters@perl.org. rt.cpan.org appears to automatically provide a URL for CPAN modules; any value given here overrides the default: http://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName
Module::CoreList currently covers the 5.000, 5.001, 5.002, 5.003_07, 5.004, 5.004_05, 5.005, 5.005_03, 5.005_04 and 5.7.3 releases of perl.
All stable releases of perl since 5.6.0 are covered.
All development releases of perl since 5.9.0 are covered.
Moved to Changes file.
Richard Clamp <richardc@unixbeard.net>
Currently maintained by the perl 5 porters <perl5-porters@perl.org>.
Copyright (C) 2002-2009 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
corelist, the Module::Info manpage, the perl manpage, http://perlpunks.de/corelist
Module::CoreList - what modules shipped with versions of perl |