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