#!../miniperl
+use strict;
+use warnings;
+
$ENV{LC_ALL} = 'C';
-open (OUT, ">perlmodlib.tmp") or die $!;
-my (@pragma, @mod, @MANIFEST);
+use FindBin;
+chdir $FindBin::Bin or die "$0: Can't chdir $FindBin::Bin: $!";
+
+my $Quiet = @ARGV && $ARGV[0] eq '-q';
+
+open (OUT, ">perlmodlib.pod") or die $!;
+my (@pragma, @mod, @files);
+
+# MANIFEST itself is Unix style filenames, so we have to assume that Unix style
+# filenames will work.
open (MANIFEST, "../MANIFEST") or die $!;
-@MANIFEST = grep !m</(?:t|demo)/>, <MANIFEST>;
-push @MANIFEST, 'lib/Config.pod', 'lib/Errno.pm', 'lib/lib.pm',
- 'lib/DynaLoader.pm', 'lib/XSLoader.pm';
-
-for (@MANIFEST) {
- my $filename;
- next unless s|^lib/|| or m|^ext/|;
- my ($origfilename) = ($filename) = m|^(\S+)|;
- $filename =~ s|^[^/]+/|| if $filename =~ s|^ext/||;
- next unless $filename =~ m!\.p(m|od)$!;
- unless (open (MOD, "../lib/$filename")) {
- unless (open (MOD, "../$origfilename")) {
- warn "Couldn't open ../$origfilename: $!";
- next;
+@files = grep m#(?:\.pm|\.pod|_pm\.PL)#, map {s/\s.*//s; $_}
+ grep {m#^lib# || m#^ext#} grep !m#/(?:t|demo)/#, <MANIFEST>;
+
+my %exceptions = (
+ 'abbrev' => 'Text::Abbrev',
+ 'carp' => 'Carp',
+ 'getopt' => 'Getopt::Std',
+ 'B<CGI::Carp>' => 'CGI::Carp',
+ 'ModuleInfo' => 'Module::Build::ModuleInfo',
+ '$notes_name' => 'Module::Build::Notes',
+ 'Encode::MIME::NAME' => 'Encode::MIME::Name',
+ 'libnetFAQ' => 'Net::libnetFAQ',
+);
+
+for my $filename (@files) {
+ unless (open MOD, '<', "../$filename") {
+ warn "Couldn't open ../$filename: $!";
+ next;
+ }
+
+ my ($name, $thing);
+ my $foundit = 0;
+ {
+ local $/ = "";
+ while (<MOD>) {
+ next unless /^=head1 NAME/;
+ $foundit++;
+ last;
}
- $filename = $origfilename;
- }
-
-
- my ($name, $thing);
- my $foundit=0;
- {
- local $/="";
- while (<MOD>) {
- next unless /^=head1 NAME/;
- $foundit++;
- last;
- }
- }
- unless ($foundit) {
- warn "$filename missing =head1 NAME (okay if there is respective .pod)\n";
- next;
- }
- my $title = <MOD>;
- chomp($title);
- close MOD;
-
- my $perlname = $filename;
- $perlname =~ s!^.*\b(ext|lib)/!!;
- $perlname =~ s!\.p(m|od)$!!;
- $perlname =~ s!\b(\w+)/\1\b!$1!;
- $perlname =~ s!/!::!g;
-
- ($name, $thing) = split / --? /, $title, 2;
-
- unless ($name and $thing) {
- warn "$filename missing name\n" unless $name;
- warn "$filename missing thing\n" unless $thing;
- next;
- }
-
-
- $thing =~ s/^perl pragma to //i;
- $thing = ucfirst($thing);
- $title = "=item $perlname\n\n$thing\n\n";
-
- if ($filename =~ /[A-Z]/) {
- push @mod, $title;
- } else {
- push @pragma, $title;
- }
+ }
+ unless ($foundit) {
+ warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"
+ unless $Quiet;
+ next;
+ }
+ my $title = <MOD>;
+ chomp $title;
+ close MOD;
+
+ ($name, $thing) = split / --? /, $title, 2;
+
+ unless ($name and $thing) {
+ warn "$filename missing name\n" unless $name;
+ warn "$filename missing thing\n" unless $thing or $Quiet;
+ next;
+ }
+
+ $name =~ s/[^A-Za-z0-9_:\$<>].*//;
+ $name = $exceptions{$name} || $name;
+ $thing =~ s/^perl pragma to //i;
+ $thing = ucfirst $thing;
+ $title = "=item $name\n\n$thing\n\n";
+
+ if ($name =~ /[A-Z]/) {
+ push @mod, $title;
+ } else {
+ push @pragma, $title;
+ }
}
+# Much easier to special case it like this than special case the depending on
+# and parsing lib/Config.pod, or special case opening configpm and finding its
+# =head1 (which is not found with the $/="" above)
+push @mod, <<'CONFIG';
+=item Config
+
+Access Perl configuration information
+
+CONFIG
+
print OUT <<'EOF';
=for maintainers
Generated by perlmodlib.PL -- DO NOT EDIT!
ftp://ftp.u-aizu.ac.jp/pub/CPAN
ftp://ftp.kddlabs.co.jp/CPAN/
- http://mirror.nucba.ac.jp/mirror/Perl/
- ftp://mirror.nucba.ac.jp/mirror/Perl/
ftp://ftp.ayamura.org/pub/CPAN/
ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
+ http://ftp.cpan.jp/
+ ftp://ftp.cpan.jp/CPAN/
ftp://ftp.dti.ad.jp/pub/lang/CPAN/
ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
=item Russian Federation
http://cpan.tomsk.ru
- ftp://cpan.tomsk.ru/pub/CPAN
+ ftp://cpan.tomsk.ru/
=item Saudi Arabia
ftp://ftp1.sinica.edu.tw/pub1/perl/CPAN/
http://ftp.tku.edu.tw/pub/CPAN/
ftp://ftp.tku.edu.tw/pub/CPAN/
+
=item Thailand
ftp://ftp.loxinfo.co.th/pub/cpan/
=item Austria
+ http://cpan.inode.at/
+ ftp://cpan.inode.at
ftp://ftp.tuwien.ac.at/pub/CPAN/
=item Belgium
ftp://ftp.cpan.skynet.be/pub/CPAN
ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
+=item Bosnia and Herzegovina
+
+ http://cpan.blic.net/
+
=item Bulgaria
http://cpan.online.bg
=item Czech Republic
- http://ftp.fi.muni.cz/pub/CPAN/
ftp://ftp.fi.muni.cz/pub/CPAN/
ftp://sunsite.mff.cuni.cz/MIRRORS/ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.crihan.fr/mirrors/ftp.cpan.org/
http://ftp.u-strasbg.fr/CPAN
ftp://ftp.u-strasbg.fr/CPAN
- http://cpan.cict.fr/
ftp://cpan.cict.fr/pub/CPAN/
ftp://ftp.uvsq.fr/pub/perl/CPAN/
=item Poland
+ ftp://ftp.mega.net.pl/CPAN
ftp://ftp.man.torun.pl/pub/doc/CPAN/
ftp://sunsite.icm.edu.pl/pub/CPAN/
ftp://ftp.bio-net.ro/pub/CPAN
ftp://ftp.kappa.ro/pub/mirrors/ftp.perl.org/pub/CPAN/
+ ftp://ftp.lug.ro/CPAN
ftp://ftp.roedu.net/pub/CPAN/
ftp://ftp.dntis.ro/pub/cpan/
ftp://ftp.iasi.roedu.net/pub/mirrors/ftp.cpan.org/
http://cpan.rinet.ru/
ftp://cpan.rinet.ru/pub/mirror/CPAN/
ftp://ftp.aha.ru/pub/CPAN/
+ ftp://ftp.corbina.ru/pub/CPAN/
http://cpan.sai.msu.ru/
ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
http://cpan.imasd.elmundo.es/
ftp://ftp.rediris.es/mirror/CPAN/
- ftp.ri.telefonica-data.net
+ ftp://ftp.ri.telefonica-data.net/CPAN
ftp://ftp.etse.urv.es/pub/perl/
=item Sweden
=item Switzerland
+ http://cpan.mirror.solnet.ch/
+ ftp://ftp.solnet.ch/mirror/CPAN/
ftp://ftp.danyk.ch/CPAN/
ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
ftp://cpan.teleglobe.net/pub/CPAN
http://cpan.mirror.anlx.net/
ftp://ftp.mirror.anlx.net/CPAN/
+ http://cpan.etla.org/
+ ftp://cpan.etla.org/pub/CPAN
ftp://ftp.demon.co.uk/pub/CPAN/
http://cpan.m.flirble.org/
ftp://ftp.flirble.org/pub/languages/perl/CPAN/
=item Canada
-=over 4
+=over 8
=item Alberta
ftp://ftp.nrc.ca/pub/CPAN/
+=back
+
=item Mexico
http://cpan.azc.uam.mx
ftp://cpan.azc.uam.mx/mirrors/CPAN
- http://cpan.unam.mx/
- ftp://cpan.unam.mx/pub/CPAN
+ http://www.cpan.unam.mx/
+ ftp://ftp.unam.mx/pub/CPAN
http://www.msg.com.mx/CPAN/
ftp://ftp.msg.com.mx/pub/CPAN/
-=back
-
=item United States
-=over 4
+=over 8
=item Alabama
http://cpan.develooper.com/
http://www.cpan.org/
ftp://cpan.valueclick.com/pub/CPAN/
+ http://www.mednor.net/ftp/pub/mirrors/CPAN/
+ ftp://ftp.mednor.net/pub/mirrors/CPAN/
http://mirrors.gossamer-threads.com/CPAN
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/
http://mirrors.kernel.org/cpan/
ftp://mirrors.kernel.org/pub/CPAN
+ http://cpan-sj.viaverio.com/
+ ftp://cpan-sj.viaverio.com/pub/CPAN/
http://cpan.digisle.net/
ftp://cpan.digisle.net/pub/CPAN
http://www.perl.com/CPAN/
+ http://www.uberlan.net/CPAN
=item Colorado
ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
+ http://cpan.four10.com
=item Delaware
ftp://mirror.csit.fsu.edu/pub/CPAN/
http://cpan.mirrors.nks.net/
-=item Illinois
-
- http://uiarchive.uiuc.edu/mirrors/ftp/cpan.cse.msu.edu/
- ftp://uiarchive.uiuc.edu/mirrors/ftp/cpan.cse.msu.edu/
-
=item Indiana
ftp://ftp.uwsg.iu.edu/pub/perl/CPAN/
=item Michigan
ftp://cpan.cse.msu.edu/
+ http://cpan.calvin.edu/pub/CPAN
+ ftp://cpan.calvin.edu/pub/CPAN
=item Nevada
=item North Carolina
+ http://www.ibiblio.org/pub/languages/perl/CPAN
+ ftp://ftp.ibiblio.org/pub/languages/perl/CPAN
ftp://ftp.duke.edu/pub/perl/
ftp://ftp.ncsu.edu/pub/mirror/CPAN/
=item Virginia
+ http://cpan-du.viaverio.com/
+ ftp://cpan-du.viaverio.com/pub/CPAN/
http://mirrors.rcn.net/pub/lang/CPAN/
ftp://mirrors.rcn.net/pub/lang/CPAN/
http://perl.secsup.org/
http://mirror.sit.wisc.edu/pub/CPAN/
ftp://mirror.sit.wisc.edu/pub/CPAN/
+ http://mirror.aphix.com/CPAN
+ ftp://mirror.aphix.com/pub/CPAN
=back
ftp://ftp.planetmirror.com/pub/CPAN/
ftp://mirror.aarnet.edu.au/pub/perl/CPAN/
ftp://cpan.topend.com.au/pub/CPAN/
+ http://cpan.mirrors.ilisys.com.au
=item New Zealand
=head2 RSYNC Mirrors
- ftp.shellhung.org::CPAN
- ftp.cbn.net.id::CPAN
- ftp.iglu.org.il::CPAN
- ftp.kddlabs.co.jp::cpan
- ftp.ayamura.org::pub/CPAN/
- mirror.leafbug.org::CPAN
- rsync.en.com.sg::CPAN
- mirror.averse.net::cpan
- rsync.oss.eznetsols.org
- ftp.kr.FreeBSD.org::CPAN
- cpan.cdpa.nsysu.edu.tw::CPAN
- rsync.nic.funet.fi::CPAN
- ftp.u-paris10.fr::CPAN
- mir1.ovh.net::CPAN
- ftp.crihan.fr::CPAN
- ftp.gwdg.de::FTP/languages/perl/CPAN/
- ftp.leo.org::CPAN
- ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN
- gusp.dyndns.org::cpan
- cpan.teleglobe.net::CPAN
- rsync://rsync.mirror.anlx.net::CPAN
- theoryx5.uwinnipeg.ca::CPAN
- ftp.sedl.org::cpan
- archive.progeny.com::CPAN
- slugsite.louisville.edu::CPAN
- cpan.teleglobe.net::CPAN
- ftp.lug.udel.edu::cpan
- mirrors.kernel.org::mirrors/CPAN
- mirrors.phenominet.com::CPAN
- mirror.csit.fsu.edu::CPAN
- csociety-ftp.ecn.purdue.edu::CPAN
- aniani.ifa.hawaii.edu::CPAN
- www.linux.org.ar::cpan
+ www.linux.org.ar::cpan
+ theoryx5.uwinnipeg.ca::CPAN
+ ftp.shellhung.org::CPAN
+ rsync.nic.funet.fi::CPAN
+ ftp.u-paris10.fr::CPAN
+ mir1.ovh.net::CPAN
+ rsync://ftp.crihan.fr::CPAN
+ ftp.gwdg.de::FTP/languages/perl/CPAN/
+ ftp.leo.org::CPAN
+ ftp.cbn.net.id::CPAN
+ rsync://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN
+ ftp.iglu.org.il::CPAN
+ gusp.dyndns.org::cpan
+ ftp.kddlabs.co.jp::cpan
+ ftp.ayamura.org::pub/CPAN/
+ mirror.leafbug.org::CPAN
+ rsync.en.com.sg::CPAN
+ mirror.averse.net::cpan
+ rsync.oss.eznetsols.org
+ ftp.kr.FreeBSD.org::CPAN
+ ftp.solnet.ch::CPAN
+ cpan.cdpa.nsysu.edu.tw::CPAN
+ cpan.teleglobe.net::CPAN
+ rsync://rsync.mirror.anlx.net::CPAN
+ ftp.sedl.org::cpan
+ ibiblio.org::CPAN
+ cpan-du.viaverio.com::CPAN
+ aniani.ifa.hawaii.edu::CPAN
+ archive.progeny.com::CPAN
+ rsync://slugsite.louisville.edu::CPAN
+ mirror.aphix.com::CPAN
+ cpan.teleglobe.net::CPAN
+ ftp.lug.udel.edu::cpan
+ mirrors.kernel.org::mirrors/CPAN
+ mirrors.phenominet.com::CPAN
+ cpan.pair.com::CPAN
+ cpan-sj.viaverio.com::CPAN
+ mirror.csit.fsu.edu::CPAN
+ csociety-ftp.ecn.purdue.edu::CPAN
For an up-to-date listing of CPAN sites,
see http://www.cpan.org/SITES or ftp://www.cpan.org/SITES .
Does your module pass the 'empty subclass' test? If you say
C<@SUBCLASS::ISA = qw(YOURCLASS);> your applications should be able
to use SUBCLASS in exactly the same way as YOURCLASS. For example,
-does your application still work if you change: C<$obj = new YOURCLASS;>
-into: C<$obj = new SUBCLASS;> ?
+does your application still work if you change: C<< $obj = YOURCLASS->new(); >>
+into: C<< $obj = SUBCLASS->new(); >> ?
Avoid keeping any state information in your packages. It makes it
difficult for multiple other packages to use yours. Keep state
or upload to one of these sites:
https://pause.kbx.de/pause/
- http://pause.perl.org/pause/
+ http://pause.perl.org/
and notify <modules@perl.org>.
EOF
close MANIFEST or warn "$0: failed to close MANIFEST (../MANIFEST): $!";
-close OUT or warn "$0: failed to close OUT (perlmodlib.tmp): $!";
+close OUT or warn "$0: failed to close OUT (perlmodlib.pod): $!";