Commit | Line | Data |
---|---|---|
dd4d388c CBW |
1 | =head1 NAME |
2 | ||
3 | Module::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 | ||
15 | print join ', ', Module::CoreList->find_modules(qr/Data/); | |
16 | # prints 'Data::Dumper' | |
17 | print join ', ', Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008); | |
18 | # prints 'Test::Harness::Assert, Test::Harness::Straps' | |
19 | ||
20 | print join ", ", @{ $Module::CoreList::families{5.005} }; | |
21 | # prints "5.005, 5.00503, 5.00504" | |
22 | ||
23 | =head1 DESCRIPTION | |
24 | ||
25 | Module::CoreList provides information on which core and dual-life modules shipped | |
26 | with each version of L<perl>. | |
27 | ||
28 | It provides a number of mechanisms for querying this information. | |
29 | ||
30 | There is a utility called L<corelist> provided with this module | |
31 | which is a convenient way of querying from the command-line. | |
32 | ||
33 | There is a functional programming API available for programmers to query | |
34 | information. | |
35 | ||
36 | Programmers may also query the contained hash structures to find relevant | |
37 | information. | |
38 | ||
39 | =head1 FUNCTIONS API | |
40 | ||
41 | These are the functions that are available, they may either be called as functions or class methods: | |
42 | ||
43 | Module::CoreList::first_release('File::Spec'); # as a function | |
44 | ||
45 | Module::CoreList->first_release('File::Spec'); # class method | |
46 | ||
47 | =over | |
48 | ||
49 | =item C<first_release( MODULE )> | |
50 | ||
51 | Behaviour since version 2.11 | |
52 | ||
53 | Requires a MODULE name as an argument, returns the perl version when that module first | |
54 | appeared in core as ordered by perl version number or undef ( in scalar context ) | |
55 | or an empty list ( in list context ) if that module is not in core. | |
56 | ||
57 | =item C<first_release_by_date( MODULE )> | |
58 | ||
59 | Requires a MODULE name as an argument, returns the perl version when that module first | |
60 | appeared in core as ordered by release date or undef ( in scalar context ) | |
61 | or an empty list ( in list context ) if that module is not in core. | |
62 | ||
63 | =item C<find_modules( REGEX, [ LIST OF PERLS ] )> | |
64 | ||
65 | Takes a regex as an argument, returns a list of modules that match the regex given. | |
66 | If only a regex is provided applies to all modules in all perl versions. Optionally | |
67 | you may provide a list of perl versions to limit the regex search. | |
68 | ||
69 | =item C<find_version( PERL_VERSION )> | |
70 | ||
71 | Takes a perl version as an argument. Returns that perl version if it exists or C<undef> | |
72 | otherwise. | |
73 | ||
74 | =item C<is_deprecated( MODULE, PERL_VERSION )> | |
75 | ||
76 | Available in version 2.22 and above. | |
77 | ||
78 | Returns true if MODULE is marked as deprecated in PERL_VERSION. If PERL_VERSION is | |
79 | omitted, it defaults to the current version of Perl. | |
80 | ||
81 | =item C<removed_from( MODULE )> | |
82 | ||
83 | Available in version 2.32 and above | |
84 | ||
85 | Takes a module name as an argument, returns the first perl version where that module | |
86 | was removed from core. Returns undef if the given module was never in core or remains | |
87 | in core. | |
88 | ||
89 | =item C<removed_from_by_date( MODULE )> | |
90 | ||
91 | Available in version 2.32 and above | |
92 | ||
93 | Takes a module name as an argument, returns the first perl version by release date where that module | |
94 | was removed from core. Returns undef if the given module was never in core or remains | |
95 | in core. | |
96 | ||
97 | =back | |
98 | ||
99 | =head1 DATA STRUCTURES | |
100 | ||
101 | These are the hash data structures that are available: | |
102 | ||
103 | =over | |
104 | ||
105 | =item C<%Module::CoreList::version> | |
106 | ||
107 | A hash of hashes that is keyed on perl version as indicated | |
108 | in $]. The second level hash is module => version pairs. | |
109 | ||
110 | Note, it is possible for the version of a module to be unspecified, | |
111 | whereby the value is C<undef>, so use C<exists $version{$foo}{$bar}> if | |
112 | that's what you're testing for. | |
113 | ||
114 | Starting with 2.10, the special module name C<Unicode> refers to the version of | |
115 | the Unicode Character Database bundled with Perl. | |
116 | ||
117 | =item C<%Module::CoreList::released> | |
118 | ||
119 | Keyed on perl version this contains ISO | |
120 | formatted versions of the release dates, as gleaned from L<perlhist>. | |
121 | ||
122 | =item C<%Module::CoreList::families> | |
123 | ||
124 | New, in 1.96, a hash that | |
125 | clusters known perl releases by their major versions. | |
126 | ||
127 | =item C<%Module::CoreList::deprecated> | |
128 | ||
129 | A hash of hashes keyed on perl version and on module name. | |
130 | If a module is defined it indicates that that module is | |
131 | deprecated in that perl version and is scheduled for removal | |
132 | from core at some future point. | |
133 | ||
134 | =item C<%Module::CoreList::upstream> | |
135 | ||
136 | A hash that contains information on where patches should be directed | |
137 | for each core module. | |
138 | ||
139 | UPSTREAM indicates where patches should go. C<undef> implies | |
140 | that this hasn't been discussed for the module at hand. | |
141 | C<blead> indicates that the copy of the module in the blead | |
142 | sources is to be considered canonical, C<cpan> means that the | |
143 | module on CPAN is to be patched first. C<first-come> means | |
144 | that blead can be patched freely if it is in sync with the | |
145 | latest release on CPAN. | |
146 | ||
147 | =item C<%Module::CoreList::bug_tracker> | |
148 | ||
149 | A hash that contains information on the appropriate bug tracker | |
150 | for each core module. | |
151 | ||
152 | BUGS is an email or url to post bug reports. For modules with | |
153 | UPSTREAM => 'blead', use perl5-porters@perl.org. rt.cpan.org | |
154 | appears to automatically provide a URL for CPAN modules; any value | |
155 | given here overrides the default: | |
156 | http://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName | |
157 | ||
158 | =back | |
159 | ||
160 | =head1 CAVEATS | |
161 | ||
162 | Module::CoreList currently covers the 5.000, 5.001, 5.002, 5.003_07, | |
163 | 5.004, 5.004_05, 5.005, 5.005_03, 5.005_04, 5.6.0, 5.6.1, 5.6.2, 5.7.3, | |
164 | 5.8.0, 5.8.1, 5.8.2, 5.8.3, 5.8.4, 5.8.5, 5.8.6, 5.8.7, 5.8.8, 5.8.9, | |
165 | 5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4, 5.9.5, 5.10.0, 5.10.1, 5.11.0, 5.11.1, | |
166 | 5.11.2, 5.11.3, 5.11.4, 5.11.5, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, | |
167 | 5.13.0, 5.13.1, 5.13.2, 5.13.3, 5.13.4, 5.13.5, 5.13.6, 5.13.7, 5.13.8, | |
168 | 5.13.9, 5.13.10, 5.13.11, 5.14.0, 5.14.1, 5.14.2, 5.15.0, 5.15.1, 5.15.2, | |
d10490f6 | 169 | 5.15.3, 5.15.4, 5.15.5, 5.15.6, 5.15.7, 5.15.8, 5.15.9 and 5.16.0 releases of perl. |
dd4d388c CBW |
170 | |
171 | =head1 HISTORY | |
172 | ||
173 | Moved to Changes file. | |
174 | ||
175 | =head1 AUTHOR | |
176 | ||
177 | Richard Clamp E<lt>richardc@unixbeard.netE<gt> | |
178 | ||
179 | Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>. | |
180 | ||
181 | =head1 LICENSE | |
182 | ||
183 | Copyright (C) 2002-2009 Richard Clamp. All Rights Reserved. | |
184 | ||
185 | This module is free software; you can redistribute it and/or modify it | |
186 | under the same terms as Perl itself. | |
187 | ||
188 | =head1 SEE ALSO | |
189 | ||
190 | L<corelist>, L<Module::Info>, L<perl>, L<http://perlpunks.de/corelist> | |
191 | ||
192 | =cut |