Subject: | A more friendly interface |
These two patches (for the module & cli util) adds support for case-
insensitive search and using "-" instead of "::". So that, we can type:
corelist file-spec-functions
instead of
corelist File::Spec::Functions
Subject: | Module-Corelist.patch |
sub first_release {
my ($discard, $module, $version) = @_;
$module =~ s{\-}{::}g; # so that one can write CGI-Cookie
my $tmp;
my @perls;
foreach my $perl (keys %version) {
foreach my $probe (keys %{ $version{$perl} }) {
if(lc $probe eq lc $module) {
$tmp = $probe;
next if $version && not $version{$_}{ $probe } >= $version;
push @perls, $perl;
}
}
}
$_[1] = $tmp if $tmp; # fix the module name
return unless @perls;
return (sort { $released{$a} cmp $released{$b} } @perls)[0];
}
Subject: | corelist.patch |
sub module_version {
my($mod,$ver) = @_;
if ( $Opts{v} ) {
return printf " %-24s %-10s\n",
$mod,
$Module::CoreList::version{$Opts{v}}{$mod} || 'undef';
}
$ver = "" unless defined $ver;
my $ret = Module::CoreList->first_release($mod, $ver);
my $msg = "$mod $ver";
if( defined $ret ) {
$msg .= " was ";
$msg .= "first " unless $ver;
$msg .= "released with perl $ret"
} else {
$msg .= " was not in CORE (or so I think)";
}
print "\n",$msg,"\n";
if(defined $ret and exists $Opts{a} and $Opts{a}){
for my $v(
sort keys %Module::CoreList::version ){
printf " %-10s %-10s\n",
$v,
$Module::CoreList::version{$v}{$mod}
|| 'undef'
if exists $Module::CoreList::version{$v}{$mod};
}
print "\n";
}
}