corelist [-a|-d] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ...
corelist [-v <PerlVersion>] [ <ModuleName> | /<ModuleRegex>/ ] ...
corelist [-r <PerlVersion>] ...
+ corelist --utils [-d] <UtilityName> [<UtilityName>] ...
+ corelist --utils -v <PerlVersion>
corelist --feature <FeatureName> [<FeatureName>] ...
corelist --diff PerlVersion PerlVersion
corelist --upstream <ModuleName>
If you pass a perl version you get the release date for that version only.
+=item --utils
+
+lists the first version of perl each named utility program was released with
+
+May be used with -d to modify the first release criteria.
+
+If used with -v <version> then all utilities released with that version of perl
+are listed, and any utility programs named on the command line are ignored.
+
=item --feature, -f
lists the first version bundle of each named feature given
GetOptions(
\%Opts,
- qw[ help|?! man! r|release:s v|version:s a! d diff|D feature|f u|upstream ]
+ qw[ help|?! man! r|release:s v|version:s a! d diff|D utils feature|f u|upstream ]
);
pod2usage(1) if $Opts{help};
}
my $num_v = numify_version( $Opts{v} );
+
+ if ($Opts{utils}) {
+ utilities_in_version($num_v);
+ exit 0;
+ }
+
my $version_hash = Module::CoreList->find_version($num_v);
if( !$version_hash ) {
exit(0);
}
+if ($Opts{utils}) {
+ die "\n--utils only available with perl v5.19.1 or greater\n"
+ if $] < 5.019001;
+
+ die "\nprovide at least one utility name to --utils\n"
+ unless @ARGV;
+
+ warn "\n-a has no effect when --utils is used\n" if $Opts{a};
+ warn "\n--diff has no effect when --utils is used\n" if $Opts{diff};
+ warn "\n--upstream, or -u, has no effect when --utils is used\n" if $Opts{u};
+
+ my $when = maxstr(values %Module::CoreList::released);
+ print "\n","Data for $when\n";
+
+ utility_version($_) for @ARGV;
+
+ exit(0);
+}
+
if ($Opts{feature}) {
die "\n--feature is only available with perl v5.16.0 or greater\n"
if $] < 5.016;
}
}
+sub utility_version {
+ my ($utility) = @_;
+
+ require Module::CoreList::Utils;
+
+ my $released = $Opts{d}
+ ? Module::CoreList::Utils->first_release_by_date($utility)
+ : Module::CoreList::Utils->first_release($utility);
+
+ my $removed = $Opts{d}
+ ? Module::CoreList::Utils->removed_from_by_date($utility)
+ : Module::CoreList::Utils->removed_from($utility);
+
+ if ($released) {
+ print "$utility was first released with perl ", format_perl_version($released);
+ print " and later removed in ", format_perl_version($removed)
+ if $removed;
+ print "\n";
+ } else {
+ print "$utility was not in CORE (or so I think)\n";
+ }
+}
+
+sub utilities_in_version {
+ my ($version) = @_;
+
+ require Module::CoreList::Utils;
+
+ my @utilities = Module::CoreList::Utils->utilities($version);
+
+ if (not @utilities) {
+ print "\nModule::CoreList::Utils has no info on perl $version\n\n";
+ exit 1;
+ }
+
+ print "\nThe following utilities were in perl ",
+ format_perl_version($version), " CORE\n";
+ print "$_\n" for sort { lc($a) cmp lc($b) } @utilities;
+ print "\n";
+}
+
sub max_mod_len {
my $versions = shift;