3 Module::CoreList - what modules shipped with versions of perl
9 print $Module::CoreList::version{5.00503}{CPAN}; # prints 1.48
11 print Module::CoreList->first_release('File::Spec'); # prints 5.00405
12 print Module::CoreList->first_release_by_date('File::Spec'); # prints 5.005
13 print Module::CoreList->first_release('File::Spec', 0.82); # prints 5.006001
15 if (Module::CoreList::is_core('File::Spec')) {
16 print "File::Spec is a core module\n";
19 print join ', ', Module::CoreList->find_modules(qr/Data/);
20 # prints 'Data::Dumper'
22 Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008);
23 # prints 'Test::Harness::Assert, Test::Harness::Straps'
25 print join ", ", @{ $Module::CoreList::families{5.005} };
26 # prints "5.005, 5.00503, 5.00504"
30 Module::CoreList provides information on which core and dual-life modules shipped
31 with each version of L<perl>.
33 It provides a number of mechanisms for querying this information.
35 There is a utility called L<corelist> provided with this module
36 which is a convenient way of querying from the command-line.
38 There is a functional programming API available for programmers to query
41 Programmers may also query the contained hash structures to find relevant
46 These are the functions that are available, they may either be called as functions or class methods:
48 Module::CoreList::first_release('File::Spec'); # as a function
50 Module::CoreList->first_release('File::Spec'); # class method
54 =item C<first_release( MODULE )>
56 Behaviour since version 2.11
58 Requires a MODULE name as an argument, returns the perl version when that module first
59 appeared in core as ordered by perl version number or undef ( in scalar context )
60 or an empty list ( in list context ) if that module is not in core.
62 =item C<first_release_by_date( MODULE )>
64 Requires a MODULE name as an argument, returns the perl version when that module first
65 appeared in core as ordered by release date or undef ( in scalar context )
66 or an empty list ( in list context ) if that module is not in core.
68 =item C<find_modules( REGEX, [ LIST OF PERLS ] )>
70 Takes a regex as an argument, returns a list of modules that match the regex given.
71 If only a regex is provided applies to all modules in all perl versions. Optionally
72 you may provide a list of perl versions to limit the regex search.
74 =item C<find_version( PERL_VERSION )>
76 Takes a perl version as an argument. Upon successful completion, returns a
77 reference to a hash. Each element of that hash has a key which is the name of
78 a module (I<e.g.,> 'File::Path') shipped with that version of perl and a value
79 which is the version number (I<e.g.,> '2.09') of that module which shipped
80 with that version of perl . Returns C<undef> otherwise.
82 =item C<is_core( MODULE, [ MODULE_VERSION, [ PERL_VERSION ] ] )>
84 Available in version 2.99 and above.
86 Returns true if MODULE was bundled with the specified version of Perl.
87 You can optionally specify a minimum version of the module,
88 and can also specify a version of Perl.
89 If a version of Perl isn't specified,
90 C<is_core()> will use the numeric version of Perl that is running (ie C<$]>).
92 If you want to specify the version of Perl, but don't care about
93 the version of the module, pass C<undef> for the module version:
95 =item C<is_deprecated( MODULE, PERL_VERSION )>
97 Available in version 2.22 and above.
99 Returns true if MODULE is marked as deprecated in PERL_VERSION. If PERL_VERSION is
100 omitted, it defaults to the current version of Perl.
102 =item C<deprecated_in( MODULE )>
104 Available in version 2.77 and above.
106 Returns the first perl version where the MODULE was marked as deprecated. Returns C<undef>
107 if the MODULE has not been marked as deprecated.
109 =item C<removed_from( MODULE )>
111 Available in version 2.32 and above
113 Takes a module name as an argument, returns the first perl version where that module
114 was removed from core. Returns undef if the given module was never in core or remains
117 =item C<removed_from_by_date( MODULE )>
119 Available in version 2.32 and above
121 Takes a module name as an argument, returns the first perl version by release date where that module
122 was removed from core. Returns undef if the given module was never in core or remains
125 =item C<changes_between( PERL_VERSION, PERL_VERSION )>
127 Available in version 2.66 and above.
129 Given two perl versions, this returns a list of pairs describing the changes in
130 core module content between them. The list is suitable for storing in a hash.
131 The keys are library names and the values are hashrefs. Each hashref has an
132 entry for one or both of C<left> and C<right>, giving the versions of the
133 library in each of the left and right perl distributions.
135 For example, it might return these data (among others) for the difference
136 between 5.008000 and 5.008001:
138 'Pod::ParseLink' => { left => '1.05', right => '1.06' },
139 'Pod::ParseUtils' => { left => '0.22', right => '0.3' },
140 'Pod::Perldoc' => { right => '3.10' },
141 'Pod::Perldoc::BaseTo' => { right => undef },
143 This shows us two libraries being updated and two being added, one of which has
144 an undefined version in the right-hand side version.
148 =head1 DATA STRUCTURES
150 These are the hash data structures that are available:
154 =item C<%Module::CoreList::version>
156 A hash of hashes that is keyed on perl version as indicated
157 in $]. The second level hash is module => version pairs.
159 Note, it is possible for the version of a module to be unspecified,
160 whereby the value is C<undef>, so use C<exists $version{$foo}{$bar}> if
161 that's what you're testing for.
163 Starting with 2.10, the special module name C<Unicode> refers to the version of
164 the Unicode Character Database bundled with Perl.
166 =item C<%Module::CoreList::delta>
168 Available in version 3.00 and above.
170 C<%Module::CoreList::version> is implemented via C<Module::CoreList::TieHashDelta>
171 using this hash of delta changes.
173 It is a hash of hashes that is keyed on perl version. Each keyed hash will have the
176 delta_from - a previous perl version that the changes are based on
177 changed - a hash of module/versions that have changed
178 removed - a hash of modules that have been removed
180 =item C<%Module::CoreList::released>
182 Keyed on perl version this contains ISO
183 formatted versions of the release dates, as gleaned from L<perlhist>.
185 =item C<%Module::CoreList::families>
187 New, in 1.96, a hash that
188 clusters known perl releases by their major versions.
190 =item C<%Module::CoreList::deprecated>
192 A hash of hashes keyed on perl version and on module name.
193 If a module is defined it indicates that that module is
194 deprecated in that perl version and is scheduled for removal
195 from core at some future point.
197 =item C<%Module::CoreList::upstream>
199 A hash that contains information on where patches should be directed
200 for each core module.
202 UPSTREAM indicates where patches should go. C<undef> implies
203 that this hasn't been discussed for the module at hand.
204 C<blead> indicates that the copy of the module in the blead
205 sources is to be considered canonical, C<cpan> means that the
206 module on CPAN is to be patched first. C<first-come> means
207 that blead can be patched freely if it is in sync with the
208 latest release on CPAN.
210 =item C<%Module::CoreList::bug_tracker>
212 A hash that contains information on the appropriate bug tracker
213 for each core module.
215 BUGS is an email or url to post bug reports. For modules with
216 UPSTREAM => 'blead', use perl5-porters@perl.org. rt.cpan.org
217 appears to automatically provide a URL for CPAN modules; any value
218 given here overrides the default:
219 http://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName
225 Module::CoreList currently covers the 5.000, 5.001, 5.002, 5.003_07,
226 5.004, 5.004_05, 5.005, 5.005_03, 5.005_04 and 5.7.3 releases of perl.
228 All stable releases of perl since 5.6.0 are covered.
230 All development releases of perl since 5.9.0 are covered.
235 Moved to Changes file.
239 Richard Clamp E<lt>richardc@unixbeard.netE<gt>
241 Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>.
245 Copyright (C) 2002-2009 Richard Clamp. All Rights Reserved.
247 This module is free software; you can redistribute it and/or modify it
248 under the same terms as Perl itself.
252 L<corelist>, L<Module::Info>, L<perl>, L<http://perlpunks.de/corelist>