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