This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] perlreguts.pod: use the unicode name for ß and show the codepoint
[perl5.git] / Porting / corelist.pl
1 #!perl
2 # Generates info for Module::CoreList from this perl tree
3 # run this from the root of a clean perl tree
4
5 use strict;
6 use warnings;
7 use File::Find;
8 use ExtUtils::MM_Unix;
9
10 my @lines;
11 find(sub {
12     /(\.pm|_pm\.PL)$/ or return;
13     /PPPort\.pm$/ and return;
14     my $module = $File::Find::name;
15     $module =~ /\b(demo|t|private)\b/ and return; # demo or test modules
16     my $version = MM->parse_version($_);
17     defined $version or $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|(win32/|vms/|symbian/)?ext)/}{}
21         and $1 ne 'lib'
22         and ( $module =~ s{^(.*)/lib/\1\b}{$1},
23               $module =~ s{(\w+)/\1\b}{$1},
24               $module =~ s{^B/O}{O},
25               $module =~ s{^Compress/IO/Base/lib/}{},
26               $module =~ s{^Compress/IO/Zlib/}{},
27               $module =~ s{^Devel/PPPort}{Devel},
28               $module =~ s{^Encode/encoding}{encoding},
29               $module =~ s{^IPC/SysV/}{IPC/},
30               $module =~ s{^List/Util/lib/Scalar}{Scalar},
31               $module =~ s{^MIME/Base64/QuotedPrint}{MIME/QuotedPrint},
32               $module =~ s{^(?:DynaLoader|Errno|Opcode)/}{},
33             );
34     $module =~ s{/}{::}g;
35     $module =~ s/(\.pm|_pm\.PL)$//;
36     push @lines, sprintf "\t%-24s=> $version,\n", "'$module'";
37 }, 'lib', 'ext', 'win32/ext', 'vms/ext', 'symbian/ext');
38 print "    $] => {\n";
39 print sort @lines;
40 print "    },\n";