2 # Generates info for Module::CoreList from this perl tree
3 # run this from the root of a clean perl tree
13 /(\.pm|_pm\.PL)$/ or return;
14 /PPPort_pm\.PL/ and return;
15 my $module = $File::Find::name;
16 $module =~ /\b(demo|t)\b/ and return; # demo or test modules
17 my $version = MM->parse_version($_) // 'undef';
18 $version =~ /\d/ and $version = "'$version'";
19 # some heuristics to figure out the module name from the file name
20 $module =~ s{^(lib|ext)/}{}
22 and ( $module =~ s{^(.*)/lib/\1\b}{$1},
23 $module =~ s{(\w+)/\1\b}{$1},
24 $module =~ s{^Encode/encoding}{encoding},
25 $module =~ s{^MIME/Base64/QuotedPrint}{MIME/QuotedPrint},
26 $module =~ s{^List/Util/lib/Scalar}{Scalar},
27 $module =~ s{^(?:DynaLoader|Errno)/}{},
30 $module =~ s/(\.pm|_pm\.PL)$//;
31 push @lines, sprintf "\t%-24s=> $version,\n", "'$module'";