5 corelist - a commandline frontend to Module::CoreList
9 See L<Module::CoreList> for one.
14 corelist [-a|-d] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ...
15 corelist [-v <PerlVersion>] [ <ModuleName> | /<ModuleRegex>/ ] ...
23 lists all versions of the given module (or the matching modules, in case you
24 used a module regexp) in the perls Module::CoreList knows about.
28 utf8 was first released with perl 5.006
49 finds the first perl version where a module has been released by
50 date, and not by version number (as is the default).
54 help! help! help! to see more help, try --man.
62 lists all of the perl release versions we got the CoreList for.
64 If you pass a version argument (value of C<$]>, like C<5.00503> or C<5.008008>),
65 you get a list of all the modules and their respective versions.
66 (If you have the C<version> module, you can also use new-style version numbers,
69 In module filtering context, it can be used as Perl version filter.
73 As a special case, if you specify the module name C<Unicode>, you'll get
74 the version number of the Unicode Character Database bundled with the
75 requested perl versions.
87 GetOptions(\%Opts, qw[ help|?! man! v|version:s a! d ] );
89 pod2usage(1) if $Opts{help};
90 pod2usage(-verbose=>2) if $Opts{man};
94 print "\nModule::CoreList has info on the following perl versions:\n";
95 print format_perl_version($_)."\n" for sort keys %Module::CoreList::version;
100 my $num_v = numify_version( $Opts{v} );
101 my $version_hash = Module::CoreList->find_version($num_v);
103 if( !$version_hash ) {
104 print "\nModule::CoreList has no info on perl $Opts{v}\n\n";
109 print "\nThe following modules were in perl $Opts{v} CORE\n";
110 my $max_mod_len = max_mod_len($version_hash);
111 for my $mod ( sort keys %$version_hash ) {
112 printf "%-${max_mod_len}s %s\n", $mod, $version_hash->{$mod} || "";
125 if ($ARGV[0] =~ /=/) {
126 ($mod, $ver) = split /=/, shift @ARGV;
129 $ver = (@ARGV && $ARGV[0] =~ /^\d/) ? shift @ARGV : "";
132 if ($mod !~ m|^/(.*)/([imosx]*)$|) { # not a regex
133 module_version($mod,$ver);
136 eval { $re = $2 ? qr/(?$2)($1)/ : qr/$1/; }; # trap exceptions while building regex
138 # regex errors are usually like 'Quantifier follow nothing in regex; marked by ...'
139 # then we drop text after ';' to shorten message
140 my $errmsg = $@ =~ /(.*);/ ? $1 : $@;
141 warn "\n$mod is a bad regex: $errmsg\n";
144 my @mod = Module::CoreList->find_modules($re);
146 module_version($_, $ver) for @mod;
149 print "\n$mod $ver has no match in CORE (or so I think)\n";
161 my $numeric_v = numify_version($Opts{v});
162 my $version_hash = Module::CoreList->find_version($numeric_v);
164 print $mod, " ", $version_hash->{$mod} || 'undef', "\n";
167 else { die "Shouldn't happen" }
171 ? Module::CoreList->first_release_by_date(@_)
172 : Module::CoreList->first_release(@_);
174 $msg .= " $ver" if $ver;
177 ? Module::CoreList->removed_from_by_date($mod)
178 : Module::CoreList->removed_from($mod);
182 $msg .= "first " unless $ver;
183 $msg .= "released with perl " . format_perl_version($ret);
184 $msg .= " and removed from " . format_perl_version($rem) if $rem;
186 $msg .= " was not in CORE (or so I think)";
189 print "\n",$msg,"\n";
191 if(defined $ret and exists $Opts{a} and $Opts{a}){
198 my $versions = shift;
200 for my $mod (keys %$versions) {
201 $max = max($max, length $mod);
208 my($this, $that) = @_;
209 return $this if $this > $that;
216 for my $v (grep !/000$/, sort keys %Module::CoreList::version ) {
217 next unless exists $Module::CoreList::version{$v}{$mod};
219 my $mod_v = $Module::CoreList::version{$v}{$mod} || 'undef';
220 printf " %-10s %-10s\n", format_perl_version($v), $mod_v;
228 sub have_version_pm {
229 return $have_version_pm if defined $have_version_pm;
230 return $have_version_pm = eval { require version; 1 };
235 sub format_perl_version {
237 return $v if $v < 5.006 or !have_version_pm;
238 return version->new($v)->normal;
244 if ($ver =~ /\..+\./) {
246 or die "You need to install version.pm to use dotted version numbers\n";
247 $ver = version->new($ver)->numify;
255 $ corelist File::Spec
257 File::Spec was first released with perl 5.005
259 $ corelist File::Spec 0.83
261 File::Spec 0.83 was released with perl 5.007003
263 $ corelist File::Spec 0.89
265 File::Spec 0.89 was not in CORE (or so I think)
267 $ corelist File::Spec::Aliens
269 File::Spec::Aliens was not in CORE (or so I think)
271 $ corelist /IPC::Open/
273 IPC::Open2 was first released with perl 5
275 IPC::Open3 was first released with perl 5
277 $ corelist /MANIFEST/i
279 ExtUtils::Manifest was first released with perl 5.001
281 $ corelist /Template/
283 /Template/ has no match in CORE (or so I think)
285 $ corelist -v 5.8.8 B
289 $ corelist -v 5.8.8 /^B::/
311 Copyright (c) 2002-2007 by D.H. aka PodMaster
313 Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>.
315 This program is distributed under the same terms as perl itself.
316 See http://perl.org/ or http://cpan.org/ for more info on that.