3 eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
4 if 0; # not running under some shell
8 corelist - a commandline frontend to Module::CoreList
12 See L<Module::CoreList> for one.
17 corelist [-a|-d] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ...
18 corelist [-v <PerlVersion>] [ <ModuleName> | /<ModuleRegex>/ ] ...
26 lists all versions of the given module (or the matching modules, in case you
27 used a module regexp) in the perls Module::CoreList knows about.
31 utf8 was first released with perl 5.006
52 finds the first perl version where a module has been released by
53 date, and not by version number (as is the default).
57 help! help! help! to see more help, try --man.
65 lists all of the perl release versions we got the CoreList for.
67 If you pass a version argument (value of C<$]>, like C<5.00503> or C<5.008008>),
68 you get a list of all the modules and their respective versions.
69 (If you have the C<version> module, you can also use new-style version numbers,
72 In module filtering context, it can be used as Perl version filter.
76 As a special case, if you specify the module name C<Unicode>, you'll get
77 the version number of the Unicode Character Database bundled with the
78 requested perl versions.
90 GetOptions(\%Opts, qw[ help|?! man! v|version:f a! d ] );
92 pod2usage(1) if $Opts{help};
93 pod2usage(-verbose=>2) if $Opts{man};
97 print "\nModule::CoreList has info on the following perl versions:\n";
98 print "$_\n" for sort keys %Module::CoreList::version;
103 $Opts{v} = numify_version( $Opts{v} );
104 my $version_hash = Module::CoreList->find_version($Opts{v});
105 if( !$version_hash ) {
106 print "\nModule::CoreList has no info on perl v$Opts{v}\n\n";
111 print "\nThe following modules were in perl v$Opts{v} CORE\n";
112 print "$_ ", $version_hash->{$_} || " ","\n"
113 for sort keys %$version_hash;
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 $version_hash = Module::CoreList->find_version($Opts{v});
163 print $mod, " ", $version_hash->{$mod} || 'undef', "\n";
166 else { die "Shouldn't happen" }
170 ? Module::CoreList->first_release_by_date(@_)
171 : Module::CoreList->first_release(@_);
173 $msg .= " $ver" if $ver;
177 $msg .= "first " unless $ver;
178 $msg .= "released with perl $ret"
180 $msg .= " was not in CORE (or so I think)";
183 print "\n",$msg,"\n";
185 if(defined $ret and exists $Opts{a} and $Opts{a}){
187 sort keys %Module::CoreList::version ){
189 printf " %-10s %-10s\n",
191 $Module::CoreList::version{$v}{$mod}
193 if exists $Module::CoreList::version{$v}{$mod};
201 if ($ver =~ /\..+\./) {
202 eval { require version ; 1 }
203 or die "You need to install version.pm to use dotted version numbers\n";
204 $ver = version->new($ver)->numify;
212 $ corelist File::Spec
214 File::Spec was first released with perl 5.005
216 $ corelist File::Spec 0.83
218 File::Spec 0.83 was released with perl 5.007003
220 $ corelist File::Spec 0.89
222 File::Spec 0.89 was not in CORE (or so I think)
224 $ corelist File::Spec::Aliens
226 File::Spec::Aliens was not in CORE (or so I think)
228 $ corelist /IPC::Open/
230 IPC::Open2 was first released with perl 5
232 IPC::Open3 was first released with perl 5
234 $ corelist /MANIFEST/i
236 ExtUtils::Manifest was first released with perl 5.001
238 $ corelist /Template/
240 /Template/ has no match in CORE (or so I think)
242 $ corelist -v 5.8.8 B
246 $ corelist -v 5.8.8 /^B::/
268 Copyright (c) 2002-2007 by D.H. aka PodMaster
270 Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>.
272 This program is distributed under the same terms as perl itself.
273 See http://perl.org/ or http://cpan.org/ for more info on that.