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:f 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 "$_\n" for sort keys %Module::CoreList::version;
100 $Opts{v} = numify_version( $Opts{v} );
101 my $version_hash = Module::CoreList->find_version($Opts{v});
102 if( !$version_hash ) {
103 print "\nModule::CoreList has no info on perl v$Opts{v}\n\n";
108 print "\nThe following modules were in perl v$Opts{v} CORE\n";
109 print "$_ ", $version_hash->{$_} || " ","\n"
110 for sort keys %$version_hash;
122 if ($ARGV[0] =~ /=/) {
123 ($mod, $ver) = split /=/, shift @ARGV;
126 $ver = (@ARGV && $ARGV[0] =~ /^\d/) ? shift @ARGV : "";
129 if ($mod !~ m|^/(.*)/([imosx]*)$|) { # not a regex
130 module_version($mod,$ver);
133 eval { $re = $2 ? qr/(?$2)($1)/ : qr/$1/; }; # trap exceptions while building regex
135 # regex errors are usually like 'Quantifier follow nothing in regex; marked by ...'
136 # then we drop text after ';' to shorten message
137 my $errmsg = $@ =~ /(.*);/ ? $1 : $@;
138 warn "\n$mod is a bad regex: $errmsg\n";
141 my @mod = Module::CoreList->find_modules($re);
143 module_version($_, $ver) for @mod;
146 print "\n$mod $ver has no match in CORE (or so I think)\n";
158 my $version_hash = Module::CoreList->find_version($Opts{v});
160 print $mod, " ", $version_hash->{$mod} || 'undef', "\n";
163 else { die "Shouldn't happen" }
167 ? Module::CoreList->first_release_by_date(@_)
168 : Module::CoreList->first_release(@_);
170 $msg .= " $ver" if $ver;
174 $msg .= "first " unless $ver;
175 $msg .= "released with perl $ret"
177 $msg .= " was not in CORE (or so I think)";
180 print "\n",$msg,"\n";
182 if(defined $ret and exists $Opts{a} and $Opts{a}){
184 sort keys %Module::CoreList::version ){
186 printf " %-10s %-10s\n",
188 $Module::CoreList::version{$v}{$mod}
190 if exists $Module::CoreList::version{$v}{$mod};
198 if ($ver =~ /\..+\./) {
199 eval { require version ; 1 }
200 or die "You need to install version.pm to use dotted version numbers\n";
201 $ver = version->new($ver)->numify;
209 $ corelist File::Spec
211 File::Spec was first released with perl 5.005
213 $ corelist File::Spec 0.83
215 File::Spec 0.83 was released with perl 5.007003
217 $ corelist File::Spec 0.89
219 File::Spec 0.89 was not in CORE (or so I think)
221 $ corelist File::Spec::Aliens
223 File::Spec::Aliens was not in CORE (or so I think)
225 $ corelist /IPC::Open/
227 IPC::Open2 was first released with perl 5
229 IPC::Open3 was first released with perl 5
231 $ corelist /MANIFEST/i
233 ExtUtils::Manifest was first released with perl 5.001
235 $ corelist /Template/
237 /Template/ has no match in CORE (or so I think)
239 $ corelist -v 5.8.8 B
243 $ corelist -v 5.8.8 /^B::/
265 Copyright (c) 2002-2007 by D.H. aka PodMaster
267 Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>.
269 This program is distributed under the same terms as perl itself.
270 See http://perl.org/ or http://cpan.org/ for more info on that.