This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta - note changes in Win32 0.45
[perl5.git] / pod / perlmodlib.PL
CommitLineData
2e1d04bc
JH
1#!../miniperl
2
5b504182
NC
3use strict;
4use warnings;
5
1fa7ca25
JH
6$ENV{LC_ALL} = 'C';
7
291c64f4
NC
8use FindBin;
9chdir $FindBin::Bin or die "$0: Can't chdir $FindBin::Bin: $!";
10
11my $Quiet = @ARGV && $ARGV[0] eq '-q';
12
b7da254d 13open (OUT, ">perlmodlib.pod") or die $!;
cf9cbb1f 14my (@pragma, @mod, @files);
4d671226 15
291c64f4
NC
16# MANIFEST itself is Unix style filenames, so we have to assume that Unix style
17# filenames will work.
18
2e1d04bc 19open (MANIFEST, "../MANIFEST") or die $!;
cf9cbb1f 20@files = grep m#(?:\.pm|\.pod|_pm\.PL)#, map {s/\s.*//s; $_}
955fcc32 21 grep { m#^(lib|ext|dist|cpan)/# && !m#/(?:t|demo)/# } <MANIFEST>;
cf9cbb1f
NC
22
23my %exceptions = (
24 'abbrev' => 'Text::Abbrev',
25 'carp' => 'Carp',
26 'getopt' => 'Getopt::Std',
27 'B<CGI::Carp>' => 'CGI::Carp',
28 'ModuleInfo' => 'Module::Build::ModuleInfo',
29 '$notes_name' => 'Module::Build::Notes',
30 'Encode::MIME::NAME' => 'Encode::MIME::Name',
31 'libnetFAQ' => 'Net::libnetFAQ',
4e42dfb1
JB
32);
33
cf9cbb1f 34for my $filename (@files) {
e8041d9b
NC
35 unless (open MOD, '<', "../$filename") {
36 warn "Couldn't open ../$filename: $!";
37 next;
4e42dfb1 38 }
4e860d0a 39
5b504182
NC
40 my ($name, $thing);
41 my $foundit = 0;
42 {
43 local $/ = "";
44 while (<MOD>) {
45 next unless /^=head1 NAME/;
46 $foundit++;
47 last;
48 }
49 }
50 unless ($foundit) {
51 warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"
52 unless $Quiet;
53 next;
54 }
55 my $title = <MOD>;
56 chomp $title;
57 close MOD;
1fa7ca25 58
5b504182 59 ($name, $thing) = split / --? /, $title, 2;
4e42dfb1 60
5b504182
NC
61 unless ($name and $thing) {
62 warn "$filename missing name\n" unless $name;
63 warn "$filename missing thing\n" unless $thing or $Quiet;
64 next;
65 }
66
67 $name =~ s/[^A-Za-z0-9_:\$<>].*//;
68 $name = $exceptions{$name} || $name;
69 $thing =~ s/^perl pragma to //i;
70 $thing = ucfirst $thing;
71 $title = "=item $name\n\n$thing\n\n";
72
73 if ($name =~ /[A-Z]/) {
74 push @mod, $title;
75 } else {
76 push @pragma, $title;
77 }
2e1d04bc
JH
78}
79
cf9cbb1f
NC
80# Much easier to special case it like this than special case the depending on
81# and parsing lib/Config.pod, or special case opening configpm and finding its
82# =head1 (which is not found with the $/="" above)
d72ea276 83push @mod, "=item Config\n\nAccess Perl configuration information\n\n";
cf9cbb1f 84
cf9cbb1f 85
d72ea276
NC
86# The intent of using =cut as the heredoc terminator is to make the whole file
87# parse as (reasonably) sane Pod as-is to anything that attempts to
88# brute-force treat it as such. The content is already useful - this just
89# makes it tidier, by stopping anything doing this mistaking the rest of the
90# Perl code for Pod. eg http://search.cpan.org/dist/perl/pod/perlmodlib.PL
cf9cbb1f 91
d72ea276 92print OUT <<'=cut';
c165c82a
JH
93=for maintainers
94Generated by perlmodlib.PL -- DO NOT EDIT!
843dbe26 95
2e1d04bc
JH
96=head1 NAME
97
98perlmodlib - constructing new Perl modules and finding existing ones
99
2e1d04bc
JH
100=head1 THE PERL MODULE LIBRARY
101
7ef5744c 102Many modules are included in the Perl distribution. These are described
2e1d04bc 103below, and all end in F<.pm>. You may discover compiled library
7ef5744c 104files (usually ending in F<.so>) or small pieces of modules to be
2e1d04bc
JH
105autoloaded (ending in F<.al>); these were automatically generated
106by the installation process. You may also discover files in the
107library directory that end in either F<.pl> or F<.ph>. These are
108old libraries supplied so that old programs that use them still
109run. The F<.pl> files will all eventually be converted into standard
110modules, and the F<.ph> files made by B<h2ph> will probably end up
111as extension modules made by B<h2xs>. (Some F<.ph> values may
112already be available through the POSIX, Errno, or Fcntl modules.)
113The B<pl2pm> file in the distribution may help in your conversion,
114but it's just a mechanical process and therefore far from bulletproof.
115
116=head2 Pragmatic Modules
117
118They work somewhat like compiler directives (pragmata) in that they
119tend to affect the compilation of your program, and thus will usually
120work well only when used within a C<use>, or C<no>. Most of these
121are lexically scoped, so an inner BLOCK may countermand them
122by saying:
123
124 no integer;
125 no strict 'refs';
126 no warnings;
127
128which lasts until the end of that BLOCK.
129
130Some pragmas are lexically scoped--typically those that affect the
131C<$^H> hints variable. Others affect the current package instead,
132like C<use vars> and C<use subs>, which allow you to predeclare a
133variables or subroutines within a particular I<file> rather than
134just a block. Such declarations are effective for the entire file
135for which they were declared. You cannot rescind them with C<no
136vars> or C<no subs>.
137
138The following pragmas are defined (and have their own documentation).
139
140=over 12
141
d72ea276 142=cut
2e1d04bc
JH
143
144print OUT $_ for (sort @pragma);
145
d72ea276
NC
146print OUT <<'=cut';
147
2e1d04bc
JH
148=back
149
150=head2 Standard Modules
151
152Standard, bundled modules are all expected to behave in a well-defined
153manner with respect to namespace pollution because they use the
154Exporter module. See their own documentation for details.
155
7ef5744c
RGS
156It's possible that not all modules listed below are installed on your
157system. For example, the GDBM_File module will not be installed if you
158don't have the gdbm library.
159
2e1d04bc
JH
160=over 12
161
d72ea276 162=cut
2e1d04bc
JH
163
164print OUT $_ for (sort @mod);
165
d72ea276
NC
166print OUT <<'=cut';
167
2e1d04bc
JH
168=back
169
170To find out I<all> modules installed on your system, including
171those without documentation or outside the standard release,
a4373870
CW
172just use the following command (under the default win32 shell,
173double quotes should be used instead of single quotes).
2e1d04bc 174
a4373870
CW
175 % perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \
176 'find { wanted => sub { print canonpath $_ if /\.pm\z/ },
177 no_chdir => 1 }, @INC'
2e1d04bc 178
8518420c 179(The -T is here to prevent '.' from being listed in @INC.)
2e1d04bc
JH
180They should all have their own documentation installed and accessible
181via your system man(1) command. If you do not have a B<find>
182program, you can use the Perl B<find2perl> program instead, which
183generates Perl code as output you can run through perl. If you
184have a B<man> program but it doesn't find your modules, you'll have
185to fix your manpath. See L<perl> for details. If you have no
186system B<man> command, you might try the B<perldoc> program.
187
8518420c
RGS
188Note also that the command C<perldoc perllocal> gives you a (possibly
189incomplete) list of the modules that have been further installed on
190your system. (The perllocal.pod file is updated by the standard MakeMaker
191install process.)
192
2e1d04bc
JH
193=head2 Extension Modules
194
195Extension modules are written in C (or a mix of Perl and C). They
196are usually dynamically loaded into Perl if and when you need them,
da75cd15 197but may also be linked in statically. Supported extension modules
2e1d04bc
JH
198include Socket, Fcntl, and POSIX.
199
200Many popular C extension modules do not come bundled (at least, not
201completely) due to their sizes, volatility, or simply lack of time
202for adequate testing and configuration across the multitude of
203platforms on which Perl was beta-tested. You are encouraged to
204look for them on CPAN (described below), or using web search engines
7ef5744c 205like Alta Vista or Google.
2e1d04bc
JH
206
207=head1 CPAN
208
209CPAN stands for Comprehensive Perl Archive Network; it's a globally
210replicated trove of Perl materials, including documentation, style
211guides, tricks and traps, alternate ports to non-Unix systems and
212occasional binary distributions for these. Search engines for
1577cd80 213CPAN can be found at http://www.cpan.org/
2e1d04bc
JH
214
215Most importantly, CPAN includes around a thousand unbundled modules,
216some of which require a C compiler to build. Major categories of
217modules are:
218
219=over
220
221=item *
ac634a9a 222
2e1d04bc
JH
223Language Extensions and Documentation Tools
224
225=item *
ac634a9a 226
2e1d04bc
JH
227Development Support
228
229=item *
ac634a9a 230
2e1d04bc
JH
231Operating System Interfaces
232
233=item *
ac634a9a 234
2e1d04bc
JH
235Networking, Device Control (modems) and InterProcess Communication
236
237=item *
ac634a9a 238
2e1d04bc
JH
239Data Types and Data Type Utilities
240
241=item *
ac634a9a 242
2e1d04bc
JH
243Database Interfaces
244
245=item *
ac634a9a 246
2e1d04bc
JH
247User Interfaces
248
249=item *
ac634a9a 250
2e1d04bc
JH
251Interfaces to / Emulations of Other Programming Languages
252
253=item *
ac634a9a 254
2e1d04bc
JH
255File Names, File Systems and File Locking (see also File Handles)
256
257=item *
ac634a9a 258
2e1d04bc
JH
259String Processing, Language Text Processing, Parsing, and Searching
260
261=item *
ac634a9a 262
2e1d04bc
JH
263Option, Argument, Parameter, and Configuration File Processing
264
265=item *
ac634a9a 266
2e1d04bc
JH
267Internationalization and Locale
268
269=item *
ac634a9a 270
2e1d04bc
JH
271Authentication, Security, and Encryption
272
273=item *
ac634a9a 274
2e1d04bc
JH
275World Wide Web, HTML, HTTP, CGI, MIME
276
277=item *
ac634a9a 278
2e1d04bc
JH
279Server and Daemon Utilities
280
281=item *
ac634a9a 282
2e1d04bc
JH
283Archiving and Compression
284
285=item *
ac634a9a 286
2e1d04bc
JH
287Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing
288
289=item *
ac634a9a 290
2e1d04bc
JH
291Mail and Usenet News
292
293=item *
ac634a9a 294
2e1d04bc
JH
295Control Flow Utilities (callbacks and exceptions etc)
296
297=item *
ac634a9a 298
2e1d04bc
JH
299File Handle and Input/Output Stream Utilities
300
301=item *
ac634a9a 302
2e1d04bc
JH
303Miscellaneous Modules
304
305=back
306
9d169eb4 307The list of the registered CPAN sites follows.
5df44211
JH
308Please note that the sorting order is alphabetical on fields:
309
310Continent
311 |
312 |-->Country
313 |
314 |-->[state/province]
315 |
316 |-->ftp
317 |
318 |-->[http]
319
320and thus the North American servers happen to be listed between the
321European and the South American sites.
322
9d169eb4 323Registered CPAN sites
2e1d04bc 324
04b029fe
LB
325=for maintainers
326Generated by Porting/make_modlib_cpan.pl
327
4e860d0a
JH
328=head2 Africa
329
330=over 4
331
5df44211 332=item South Africa
4e860d0a 333
04b029fe
LB
334 http://cpan.mirror.ac.za/
335 ftp://cpan.mirror.ac.za/
336 http://mirror.is.co.za/pub/cpan/
337 ftp://ftp.is.co.za/pub/cpan/
338 ftp://ftp.saix.net/pub/CPAN/
4e860d0a
JH
339
340=back
341
342=head2 Asia
343
344=over 4
345
04b029fe
LB
346=item China
347
348 http://cpan.wenzk.com/
349
9d169eb4 350=item Hong Kong
4e860d0a 351
04b029fe
LB
352 http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/
353 ftp://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/
354 http://mirrors.geoexpat.com/cpan/
c165c82a 355
9d169eb4 356=item India
c165c82a 357
04b029fe 358 http://perlmirror.indialinks.com/
c165c82a 359
9d169eb4 360=item Indonesia
c165c82a 361
04b029fe
LB
362 http://cpan.biz.net.id/
363 http://komo.vlsm.org/CPAN/
364 ftp://komo.vlsm.org/CPAN/
365 http://cpan.cermin.lipi.go.id/
366 ftp://cermin.lipi.go.id/pub/CPAN/
367 http://cpan.pesat.net.id/
c165c82a 368
5df44211 369=item Japan
c165c82a 370
04b029fe
LB
371 ftp://ftp.u-aizu.ac.jp/pub/CPAN
372 ftp://ftp.kddilabs.jp/CPAN/
373 http://ftp.nara.wide.ad.jp/pub/CPAN/
374 ftp://ftp.nara.wide.ad.jp/pub/CPAN/
375 http://ftp.jaist.ac.jp/pub/CPAN/
376 ftp://ftp.jaist.ac.jp/pub/CPAN/
377 ftp://ftp.dti.ad.jp/pub/lang/CPAN/
378 ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
379 http://ftp.riken.jp/lang/CPAN/
380 ftp://ftp.riken.jp/lang/CPAN/
381 http://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/
382 ftp://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/
4e860d0a 383
9d169eb4 384=item Republic of Korea
4e860d0a 385
04b029fe
LB
386 http://ftp.kaist.ac.kr/pub/CPAN
387 ftp://ftp.kaist.ac.kr/pub/CPAN
388 http://cpan.mirror.cdnetworks.com/
389 ftp://cpan.mirror.cdnetworks.com/CPAN/
390 http://cpan.sarang.net/
391 ftp://cpan.sarang.net/CPAN/
4e860d0a 392
9d169eb4 393=item Russia
4e860d0a 394
04b029fe
LB
395 http://cpan.tomsk.ru/
396 ftp://cpan.tomsk.ru/
4e860d0a 397
5df44211 398=item Singapore
4e860d0a 399
04b029fe
LB
400 http://mirror.averse.net/pub/CPAN
401 ftp://mirror.averse.net/pub/CPAN
402 http://cpan.mirror.choon.net/
403 http://cpan.oss.eznetsols.org
404 ftp://ftp.oss.eznetsols.org/cpan
4e860d0a 405
5df44211 406=item Taiwan
4e860d0a 407
04b029fe
LB
408 http://ftp.cse.yzu.edu.tw/pub/CPAN/
409 ftp://ftp.cse.yzu.edu.tw/pub/CPAN/
410 http://cpan.nctu.edu.tw/
411 ftp://cpan.nctu.edu.tw/
412 ftp://ftp.ncu.edu.tw/CPAN/
413 http://cpan.cdpa.nsysu.edu.tw/
414 ftp://cpan.cdpa.nsysu.edu.tw/Unix/Lang/CPAN/
415 http://cpan.stu.edu.tw
416 ftp://ftp.stu.edu.tw/CPAN
417 http://ftp.stu.edu.tw/CPAN
418 ftp://ftp.stu.edu.tw/pub/CPAN
419 http://cpan.cs.pu.edu.tw/
420 ftp://cpan.cs.pu.edu.tw/pub/CPAN
7a142657 421
5df44211 422=item Thailand
4e860d0a 423
04b029fe
LB
424 http://mirrors.issp.co.th/cpan/
425 ftp://mirrors.issp.co.th/cpan/
426 http://mirror.yourconnect.com/CPAN/
427 ftp://mirror.yourconnect.com/CPAN/
9d169eb4
LB
428
429=item Turkey
430
04b029fe 431 http://cpan.gazi.edu.tr/
4e860d0a
JH
432
433=back
434
435=head2 Central America
436
437=over 4
438
5df44211 439=item Costa Rica
4e860d0a 440
04b029fe
LB
441 http://mirrors.ucr.ac.cr/CPAN/
442 ftp://mirrors.ucr.ac.cr/CPAN/
4e860d0a
JH
443
444=back
445
446=head2 Europe
447
448=over 4
449
5df44211 450=item Austria
4e860d0a 451
04b029fe
LB
452 http://cpan.inode.at/
453 ftp://cpan.inode.at
454 http://gd.tuwien.ac.at/languages/perl/CPAN/
455 ftp://gd.tuwien.ac.at/pub/CPAN/
4e860d0a 456
5df44211 457=item Belgium
4e860d0a 458
04b029fe
LB
459 http://ftp.belnet.be/mirror/ftp.cpan.org/
460 ftp://ftp.belnet.be/mirror/ftp.cpan.org/
461 http://ftp.easynet.be/pub/CPAN/
462 http://cpan.weepee.org/
4e860d0a 463
7a142657
JH
464=item Bosnia and Herzegovina
465
04b029fe 466 http://cpan.blic.net/
7a142657 467
5df44211 468=item Bulgaria
4e860d0a 469
04b029fe
LB
470 http://cpan.cbox.biz/
471 ftp://cpan.cbox.biz/cpan/
472 http://cpan.digsys.bg/
473 ftp://ftp.digsys.bg/pub/CPAN
4e860d0a 474
5df44211 475=item Croatia
4e860d0a 476
04b029fe
LB
477 http://ftp.carnet.hr/pub/CPAN/
478 ftp://ftp.carnet.hr/pub/CPAN/
4e860d0a 479
5df44211 480=item Czech Republic
4e860d0a 481
04b029fe
LB
482 ftp://ftp.fi.muni.cz/pub/CPAN/
483 http://archive.cpan.cz/
4e860d0a 484
5df44211 485=item Denmark
4e860d0a 486
04b029fe
LB
487 http://mirrors.dotsrc.org/cpan
488 ftp://mirrors.dotsrc.org/cpan/
489 http://www.cpan.dk/
490 http://mirror.uni-c.dk/pub/CPAN/
4e860d0a 491
5df44211 492=item Finland
4e860d0a 493
04b029fe
LB
494 ftp://ftp.funet.fi/pub/languages/perl/CPAN/
495 http://mirror.eunet.fi/CPAN
4e860d0a 496
5df44211 497=item France
c165c82a 498
04b029fe
LB
499 http://cpan.enstimac.fr/
500 ftp://ftp.inria.fr/pub/CPAN/
501 http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/
502 ftp://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/
503 ftp://ftp.lip6.fr/pub/perl/CPAN/
504 http://mir2.ovh.net/ftp.cpan.org
505 ftp://mir1.ovh.net/ftp.cpan.org
506 ftp://ftp.oleane.net/pub/CPAN/
507 http://ftp.crihan.fr/mirrors/ftp.cpan.org/
508 ftp://ftp.crihan.fr/mirrors/ftp.cpan.org/
509 http://ftp.u-strasbg.fr/CPAN
510 ftp://ftp.u-strasbg.fr/CPAN
511 http://cpan.cict.fr/
512 ftp://cpan.cict.fr/pub/CPAN/
c165c82a 513
5df44211 514=item Germany
c165c82a 515
04b029fe
LB
516 ftp://ftp.fu-berlin.de/unix/languages/perl/
517 http://mirrors.softliste.de/cpan/
518 ftp://ftp.rub.de/pub/CPAN/
519 http://www.planet-elektronik.de/CPAN/
520 http://ftp.hosteurope.de/pub/CPAN/
521 ftp://ftp.hosteurope.de/pub/CPAN/
522 http://www.mirrorspace.org/cpan/
523 http://mirror.netcologne.de/cpan/
524 ftp://mirror.netcologne.de/cpan/
525 ftp://ftp.freenet.de/pub/ftp.cpan.org/pub/CPAN/
526 http://ftp-stud.hs-esslingen.de/pub/Mirrors/CPAN/
527 ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/CPAN/
528 http://mirrors.zerg.biz/cpan/
529 http://ftp.gwdg.de/pub/languages/perl/CPAN/
530 ftp://ftp.gwdg.de/pub/languages/perl/CPAN/
531 http://dl.ambiweb.de/mirrors/ftp.cpan.org/
532 http://cpan.mirror.clusters.kg/
533 http://cpan.mirror.iphh.net/
534 ftp://cpan.mirror.iphh.net/pub/CPAN/
535 http://cpan.mirroring.de/
536 http://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/
537 ftp://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/
538 http://www.chemmedia.de/mirrors/CPAN/
539 http://ftp.cw.net/pub/CPAN/
540 ftp://ftp.cw.net/pub/CPAN/
541 http://cpan.cpantesters.org/
542 ftp://cpan.cpantesters.org/CPAN/
543 http://cpan.mirrored.de/
544 ftp://mirror.petamem.com/CPAN/
545 http://cpan.noris.de/
546 ftp://cpan.noris.de/pub/CPAN/
547 ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
548 ftp://ftp.gmd.de/mirrors/CPAN/
4e860d0a 549
5df44211 550=item Greece
4e860d0a 551
04b029fe
LB
552 ftp://ftp.forthnet.gr/pub/languages/perl/CPAN
553 ftp://ftp.ntua.gr/pub/lang/perl/
554 http://cpan.cc.uoc.gr/
555 ftp://ftp.cc.uoc.gr/mirrors/CPAN/
4e860d0a 556
5df44211 557=item Hungary
4e860d0a 558
04b029fe
LB
559 http://cpan.mirrors.enexis.hu/
560 ftp://cpan.mirrors.enexis.hu/mirrors/cpan/
561 http://cpan.hu/
4e860d0a 562
5df44211 563=item Iceland
4e860d0a 564
04b029fe
LB
565 http://ftp.rhnet.is/pub/CPAN/
566 ftp://ftp.rhnet.is/pub/CPAN/
4e860d0a 567
5df44211 568=item Ireland
4e860d0a 569
04b029fe
LB
570 http://ftp.esat.net/pub/languages/perl/CPAN/
571 ftp://ftp.esat.net/pub/languages/perl/CPAN/
572 http://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN
573 ftp://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN
4e860d0a 574
5df44211 575=item Italy
4e860d0a 576
04b029fe
LB
577 http://bo.mirror.garr.it/mirrors/CPAN/
578 http://cpan.panu.it/
579 ftp://ftp.panu.it/pub/mirrors/perl/CPAN/
4e860d0a 580
5df44211 581=item Latvia
4e860d0a 582
04b029fe 583 http://kvin.lv/pub/CPAN/
4e860d0a 584
5df44211 585=item Lithuania
4e860d0a 586
04b029fe
LB
587 http://ftp.litnet.lt/pub/CPAN/
588 ftp://ftp.litnet.lt/pub/CPAN/
9d169eb4
LB
589
590=item Malta
591
04b029fe 592 http://cpan.waldonet.net.mt/
4e860d0a 593
5df44211 594=item Netherlands
4e860d0a 595
04b029fe
LB
596 ftp://ftp.quicknet.nl/pub/CPAN/
597 http://mirror.hostfuss.com/CPAN/
598 ftp://mirror.hostfuss.com/CPAN/
599 http://mirrors3.kernel.org/cpan/
600 ftp://mirrors3.kernel.org/pub/CPAN/
601 http://cpan.mirror.versatel.nl/
602 ftp://ftp.mirror.versatel.nl/cpan/
603 ftp://download.xs4all.nl/pub/mirror/CPAN/
604 http://mirror.leaseweb.com/CPAN/
605 ftp://mirror.leaseweb.com/CPAN/
606 ftp://ftp.cpan.nl/pub/CPAN/
607 http://archive.cs.uu.nl/mirror/CPAN/
608 ftp://ftp.cs.uu.nl/mirror/CPAN/
609 http://luxitude.net/cpan/
4e860d0a 610
5df44211
JH
611=item Norway
612
04b029fe
LB
613 ftp://ftp.uninett.no/pub/languages/perl/CPAN
614 ftp://ftp.uit.no/pub/languages/perl/cpan/
5df44211
JH
615
616=item Poland
617
04b029fe
LB
618 http://piotrkosoft.net/pub/mirrors/CPAN/
619 ftp://ftp.piotrkosoft.net/pub/mirrors/CPAN/
620 http://ftp.man.poznan.pl/pub/CPAN
621 ftp://ftp.man.poznan.pl/pub/CPAN
622 ftp://ftp.ps.pl/pub/CPAN/
623 ftp://sunsite.icm.edu.pl/pub/CPAN/
624 ftp://ftp.tpnet.pl/d4/CPAN/
5df44211
JH
625
626=item Portugal
627
04b029fe
LB
628 http://cpan.dei.uc.pt/
629 ftp://ftp.dei.uc.pt/pub/CPAN
630 ftp://ftp.ist.utl.pt/pub/CPAN/
631 http://cpan.perl.pt/
632 http://cpan.ip.pt/
633 ftp://cpan.ip.pt/pub/cpan/
634 http://mirrors.nfsi.pt/CPAN/
635 ftp://mirrors.nfsi.pt/pub/CPAN/
636 http://cpan.dcc.fc.up.pt/
4e860d0a 637
5df44211 638=item Romania
4e860d0a 639
04b029fe
LB
640 http://ftp.astral.ro/pub/CPAN/
641 ftp://ftp.astral.ro/pub/CPAN/
642 ftp://ftp.lug.ro/CPAN
643 http://mirrors.xservers.ro/CPAN/
644 http://mirrors.hostingromania.ro/ftp.cpan.org/
645 ftp://ftp.hostingromania.ro/mirrors/ftp.cpan.org/
646 ftp://ftp.iasi.roedu.net/pub/mirrors/ftp.cpan.org/
4e860d0a 647
5df44211 648=item Russia
4e860d0a 649
04b029fe
LB
650 ftp://ftp.aha.ru/CPAN/
651 http://cpan.rinet.ru/
652 ftp://cpan.rinet.ru/pub/mirror/CPAN/
653 ftp://ftp.SpringDaemons.com/pub/CPAN/
654 http://mirror.rol.ru/CPAN/
655 http://ftp.silvernet.ru/CPAN/
656 http://ftp.spbu.ru/CPAN/
657 ftp://ftp.spbu.ru/CPAN/
4e860d0a 658
5df44211 659=item Slovakia
4e860d0a 660
04b029fe 661 http://cpan.fyxm.net/
4e860d0a 662
5df44211 663=item Slovenia
4e860d0a 664
04b029fe 665 http://www.klevze.si/cpan
4e860d0a 666
5df44211 667=item Spain
4e860d0a 668
04b029fe
LB
669 http://osl.ugr.es/CPAN/
670 ftp://ftp.rediris.es/mirror/CPAN/
671 http://ftp.gui.uva.es/sites/cpan.org/
672 ftp://ftp.gui.uva.es/sites/cpan.org/
4e860d0a 673
5df44211 674=item Sweden
4e860d0a 675
04b029fe
LB
676 http://mirrors4.kernel.org/cpan/
677 ftp://mirrors4.kernel.org/pub/CPAN/
4e860d0a 678
5df44211 679=item Switzerland
4e860d0a 680
04b029fe
LB
681 http://cpan.mirror.solnet.ch/
682 ftp://ftp.solnet.ch/mirror/CPAN/
683 ftp://ftp.adwired.ch/CPAN/
684 http://mirror.switch.ch/ftp/mirror/CPAN/
685 ftp://mirror.switch.ch/mirror/CPAN/
c165c82a 686
5df44211 687=item Ukraine
c165c82a 688
04b029fe
LB
689 http://cpan.makeperl.org/
690 ftp://cpan.makeperl.org/pub/CPAN
691 http://cpan.org.ua/
692 http://cpan.gafol.net/
693 ftp://ftp.gafol.net/pub/cpan/
c165c82a 694
5df44211 695=item United Kingdom
d4858812 696
04b029fe
LB
697 http://www.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/
698 ftp://ftp.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/
699 http://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/
700 ftp://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/
701 http://www.mirror.8086.net/sites/CPAN/
702 ftp://ftp.mirror.8086.net/sites/CPAN/
703 http://cpan.mirror.anlx.net/
704 ftp://ftp.mirror.anlx.net/CPAN/
705 http://mirror.bytemark.co.uk/CPAN/
706 ftp://mirror.bytemark.co.uk/CPAN/
707 http://cpan.etla.org/
708 ftp://cpan.etla.org/pub/CPAN
709 ftp://ftp.demon.co.uk/pub/CPAN/
710 http://mirror.sov.uk.goscomb.net/CPAN/
711 ftp://mirror.sov.uk.goscomb.net/pub/CPAN/
712 http://ftp.plig.net/pub/CPAN/
713 ftp://ftp.plig.net/pub/CPAN/
714 http://ftp.ticklers.org/pub/CPAN/
715 ftp://ftp.ticklers.org/pub/CPAN/
716 http://cpan.mirrors.uk2.net/
717 ftp://mirrors.uk2.net/pub/CPAN/
718 http://mirror.ox.ac.uk/sites/www.cpan.org/
719 ftp://mirror.ox.ac.uk/sites/www.cpan.org/
d4858812 720
4e860d0a
JH
721=back
722
723=head2 North America
724
725=over 4
726
9d169eb4 727=item Bahamas
5c5c2539 728
04b029fe 729 http://www.securehost.com/mirror/CPAN/
5c5c2539 730
9d169eb4 731=item Canada
4e860d0a 732
04b029fe
LB
733 http://cpan.arcticnetwork.ca
734 ftp://mirror.arcticnetwork.ca/pub/CPAN
735 http://cpan.sunsite.ualberta.ca/
736 ftp://cpan.sunsite.ualberta.ca/pub/CPAN/
737 http://theoryx5.uwinnipeg.ca/pub/CPAN/
738 ftp://theoryx5.uwinnipeg.ca/pub/CPAN/
739 http://arwen.cs.dal.ca/mirror/CPAN/
740 ftp://arwen.cs.dal.ca/pub/mirror/CPAN/
741 http://CPAN.mirror.rafal.ca/
742 ftp://CPAN.mirror.rafal.ca/pub/CPAN/
743 ftp://ftp.nrc.ca/pub/CPAN/
744 http://mirror.csclub.uwaterloo.ca/pub/CPAN/
745 ftp://mirror.csclub.uwaterloo.ca/pub/CPAN/
7a142657 746
5df44211 747=item Mexico
c165c82a 748
04b029fe
LB
749 http://www.msg.com.mx/CPAN/
750 ftp://ftp.msg.com.mx/pub/CPAN/
c165c82a 751
5c5c2539 752=item United States
d4858812 753
7a142657 754=over 8
4e860d0a 755
5df44211 756=item Alabama
4e860d0a 757
04b029fe
LB
758 http://mirror.hiwaay.net/CPAN/
759 ftp://mirror.hiwaay.net/CPAN/
760
761=item Arizona
762
763 http://cpan.ezarticleinformation.com/
4e860d0a 764
5df44211 765=item California
4e860d0a 766
04b029fe
LB
767 http://cpan.knowledgematters.net/
768 http://cpan.binkerton.com/
769 http://cpan.develooper.com/
770 http://mirrors.gossamer-threads.com/CPAN
771 http://cpan.schatt.com/
772 http://mirrors.kernel.org/cpan/
773 ftp://mirrors.kernel.org/pub/CPAN
774 http://mirrors2.kernel.org/cpan/
775 ftp://mirrors2.kernel.org/pub/CPAN/
776 http://cpan.mirror.facebook.net/
777 http://mirrors1.kernel.org/cpan/
778 ftp://mirrors1.kernel.org/pub/CPAN/
779 http://cpan-sj.viaverio.com/
780 ftp://cpan-sj.viaverio.com/pub/CPAN/
781 http://www.perl.com/CPAN/
4e860d0a 782
9d169eb4 783=item Florida
4e860d0a 784
04b029fe
LB
785 ftp://ftp.cise.ufl.edu/pub/mirrors/CPAN/
786 http://mirror.atlantic.net/pub/CPAN/
787 ftp://mirror.atlantic.net/pub/CPAN/
4e860d0a 788
9d169eb4 789=item Idaho
4e860d0a 790
04b029fe
LB
791 http://mirror.its.uidaho.edu/pub/cpan/
792 ftp://mirror.its.uidaho.edu/cpan/
4e860d0a 793
9d169eb4 794=item Illinois
c165c82a 795
04b029fe
LB
796 http://cpan.mirrors.hoobly.com/
797 http://cpan.uchicago.edu/pub/CPAN/
798 ftp://cpan.uchicago.edu/pub/CPAN/
799 http://mirrors.servercentral.net/CPAN/
800 http://www.stathy.com/CPAN/
801 ftp://www.stathy.com/CPAN/
c165c82a 802
5df44211 803=item Indiana
4e860d0a 804
04b029fe
LB
805 ftp://ftp.uwsg.iu.edu/pub/perl/CPAN/
806 http://cpan.netnitco.net/
807 ftp://cpan.netnitco.net/pub/mirrors/CPAN/
808 http://ftp.ndlug.nd.edu/pub/perl/
809 ftp://ftp.ndlug.nd.edu/pub/perl/
4e860d0a 810
5df44211 811=item Massachusetts
4e860d0a 812
04b029fe 813 http://mirrors.ccs.neu.edu/CPAN/
4e860d0a 814
5df44211 815=item Michigan
4e860d0a 816
04b029fe
LB
817 http://ftp.wayne.edu/cpan/
818 ftp://ftp.wayne.edu/cpan/
4e860d0a 819
9d169eb4 820=item Minnesota
5c5c2539 821
04b029fe 822 http://cpan.msi.umn.edu/
5c5c2539 823
5df44211 824=item New Jersey
4e860d0a 825
04b029fe
LB
826 http://mirror.datapipe.net/CPAN/
827 ftp://mirror.datapipe.net/pub/CPAN/
4e860d0a 828
5df44211 829=item New York
4e860d0a 830
04b029fe
LB
831 http://mirrors.24-7-solutions.net/pub/CPAN/
832 ftp://mirrors.24-7-solutions.net/pub/CPAN/
833 http://mirror.cc.columbia.edu/pub/software/cpan/
834 ftp://mirror.cc.columbia.edu/pub/software/cpan/
835 http://cpan.belfry.net/
836 http://cpan.erlbaum.net/
837 ftp://cpan.erlbaum.net/CPAN/
838 http://cpan.hexten.net/
839 ftp://cpan.hexten.net/
840 ftp://mirror.nyi.net/CPAN/
841 http://mirror.rit.edu/CPAN/
842 ftp://mirror.rit.edu/CPAN/
4e860d0a 843
5df44211 844=item North Carolina
4e860d0a 845
04b029fe
LB
846 http://www.ibiblio.org/pub/mirrors/CPAN
847 ftp://ftp.ncsu.edu/pub/mirror/CPAN/
4e860d0a 848
5df44211 849=item Oregon
4e860d0a 850
04b029fe
LB
851 http://ftp.osuosl.org/pub/CPAN/
852 ftp://ftp.osuosl.org/pub/CPAN/
4e860d0a 853
5df44211 854=item Pennsylvania
4e860d0a 855
04b029fe
LB
856 http://ftp.epix.net/CPAN/
857 ftp://ftp.epix.net/pub/languages/perl/
858 http://cpan.pair.com/
859 ftp://cpan.pair.com/pub/CPAN/
9d169eb4
LB
860
861=item South Carolina
862
04b029fe 863 http://cpan.mirror.clemson.edu/
4e860d0a 864
5df44211 865=item Tennessee
4e860d0a 866
04b029fe 867 http://mira.sunsite.utk.edu/CPAN/
4e860d0a 868
5df44211 869=item Texas
4e860d0a 870
04b029fe 871 http://mirror.uta.edu/CPAN
4e860d0a 872
5df44211 873=item Utah
4e860d0a 874
04b029fe 875 ftp://mirror.xmission.com/CPAN/
4e860d0a 876
5df44211 877=item Virginia
4e860d0a 878
04b029fe
LB
879 http://cpan-du.viaverio.com/
880 ftp://cpan-du.viaverio.com/pub/CPAN/
881 http://perl.secsup.org/
882 ftp://perl.secsup.org/pub/perl/
883 ftp://mirror.cogentco.com/pub/CPAN/
4e860d0a 884
5c5c2539 885=item Washington
4e860d0a 886
04b029fe
LB
887 http://cpan.llarian.net/
888 ftp://cpan.llarian.net/pub/CPAN/
889 ftp://ftp-mirror.internap.com/pub/CPAN/
d4858812 890
5df44211 891=item Wisconsin
d4858812 892
04b029fe
LB
893 http://cpan.mirrors.tds.net
894 ftp://cpan.mirrors.tds.net/pub/CPAN
895 http://mirror.sit.wisc.edu/pub/CPAN/
896 ftp://mirror.sit.wisc.edu/pub/CPAN/
4e860d0a
JH
897
898=back
899
5c5c2539
JH
900=back
901
4e860d0a
JH
902=head2 Oceania
903
904=over 4
905
5df44211 906=item Australia
4e860d0a 907
04b029fe
LB
908 http://mirror.internode.on.net/pub/cpan/
909 ftp://mirror.internode.on.net/pub/cpan/
910 http://cpan.mirror.aussiehq.net.au/
911 http://mirror.as24220.net/cpan/
912 ftp://mirror.as24220.net/cpan/
4e860d0a 913
5df44211 914=item New Zealand
d4858812 915
04b029fe
LB
916 ftp://ftp.auckland.ac.nz/pub/perl/CPAN/
917 http://cpan.inspire.net.nz
918 ftp://cpan.inspire.net.nz/cpan
919 http://cpan.catalyst.net.nz/CPAN/
920 ftp://cpan.catalyst.net.nz/pub/CPAN/
4e860d0a
JH
921
922=back
923
924=head2 South America
925
926=over 4
927
5df44211 928=item Argentina
4e860d0a 929
04b029fe
LB
930 http://cpan.patan.com.ar/
931 http://cpan.localhost.net.ar
932 ftp://mirrors.localhost.net.ar/pub/mirrors/CPAN
4e860d0a 933
5df44211 934=item Brazil
4e860d0a 935
04b029fe
LB
936 ftp://cpan.pop-mg.com.br/pub/CPAN/
937 http://ftp.pucpr.br/CPAN
938 ftp://ftp.pucpr.br/CPAN
939 http://cpan.kinghost.net/
4e860d0a 940
5df44211 941=item Chile
4e860d0a 942
04b029fe
LB
943 http://cpan.dcc.uchile.cl/
944 ftp://cpan.dcc.uchile.cl/pub/lang/cpan/
9d169eb4
LB
945
946=item Colombia
947
04b029fe 948 http://www.laqee.unal.edu.co/CPAN/
2e1d04bc
JH
949
950=back
951
5df44211
JH
952=head2 RSYNC Mirrors
953
9d169eb4
LB
954 mirror.as24220.net::cpan
955 cpan.inode.at::CPAN
956 gd.tuwien.ac.at::CPAN
957 ftp.belnet.be::packages/cpan
958 rsync.linorg.usp.br::CPAN
959 rsync.arcticnetwork.ca::CPAN
960 CPAN.mirror.rafal.ca::CPAN
961 mirror.csclub.uwaterloo.ca::CPAN
7a142657 962 theoryx5.uwinnipeg.ca::CPAN
9d169eb4
LB
963 www.laqee.unal.edu.co::CPAN
964 mirror.uni-c.dk::CPAN
7a142657 965 rsync.nic.funet.fi::CPAN
9d169eb4 966 rsync://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/
7a142657 967 mir1.ovh.net::CPAN
9d169eb4
LB
968 miroir-francais.fr::cpan
969 ftp.crihan.fr::CPAN
970 rsync://mirror.cict.fr/cpan/
971 rsync://mirror.netcologne.de/cpan/
972 ftp-stud.hs-esslingen.de::CPAN/
7a142657 973 ftp.gwdg.de::FTP/languages/perl/CPAN/
9d169eb4
LB
974 cpan.mirror.iphh.net::CPAN
975 cpan.cpantesters.org::cpan
976 cpan.hu::CPAN
977 komo.vlsm.org::CPAN
978 mirror.unej.ac.id::cpan
979 ftp.esat.net::/pub/languages/perl/CPAN
980 ftp.heanet.ie::mirrors/ftp.perl.org/pub/CPAN
981 rsync.panu.it::CPAN
982 cpan.fastbull.org::CPAN
983 ftp.kddilabs.jp::cpan
984 ftp.nara.wide.ad.jp::cpan/
985 rsync://ftp.jaist.ac.jp/pub/CPAN/
986 rsync://ftp.riken.jp/cpan/
987 mirror.linuxiso.kz::CPAN
988 rsync://mirrors3.kernel.org/mirrors/CPAN/
989 rsync://rsync.osmirror.nl/cpan/
990 mirror.leaseweb.com::CPAN
991 cpan.nautile.nc::CPAN
992 mirror.icis.pcz.pl::CPAN
993 piotrkosoft.net::mirrors/CPAN
994 rsync://cpan.perl.pt/
995 ftp.kaist.ac.kr::cpan
996 cpan.sarang.net::CPAN
7a142657
JH
997 mirror.averse.net::cpan
998 rsync.oss.eznetsols.org
9d169eb4
LB
999 mirror.ac.za::cpan
1000 ftp.is.co.za::IS-Mirror/ftp.cpan.org/
1001 rsync://ftp.gui.uva.es/cpan/
1002 rsync://mirrors4.kernel.org/mirrors/CPAN/
7a142657 1003 ftp.solnet.ch::CPAN
9d169eb4
LB
1004 ftp.ulak.net.tr::CPAN
1005 gafol.net::cpan
1006 rsync.mirrorservice.org::ftp.funet.fi/pub/
1007 rsync://rsync.mirror.8086.net/CPAN/
1008 rsync.mirror.anlx.net::CPAN
1009 mirror.bytemark.co.uk::CPAN
1010 ftp.plig.net::CPAN
1011 rsync://ftp.ticklers.org:CPAN/
1012 mirrors.ibiblio.org::CPAN
7a142657 1013 cpan-du.viaverio.com::CPAN
9d169eb4
LB
1014 mirror.hiwaay.net::CPAN
1015 rsync://mira.sunsite.utk.edu/CPAN/
1016 cpan.mirrors.tds.net::CPAN
1017 mirror.its.uidaho.edu::cpan
1018 rsync://mirror.cc.columbia.edu::cpan/
1019 ftp.fxcorporate.com::CPAN
1020 rsync.atlantic.net::CPAN
7a142657 1021 mirrors.kernel.org::mirrors/CPAN
9d169eb4 1022 rsync://mirrors2.kernel.org/mirrors/CPAN/
7a142657 1023 cpan.pair.com::CPAN
9d169eb4
LB
1024 rsync://mirror.rit.edu/CPAN/
1025 rsync://mirror.facebook.net/cpan/
1026 rsync://mirrors1.kernel.org/mirrors/CPAN/
7a142657 1027 cpan-sj.viaverio.com::CPAN
5df44211 1028
2e1d04bc 1029For an up-to-date listing of CPAN sites,
4e860d0a 1030see http://www.cpan.org/SITES or ftp://www.cpan.org/SITES .
2e1d04bc
JH
1031
1032=head1 Modules: Creation, Use, and Abuse
1033
1034(The following section is borrowed directly from Tim Bunce's modules
1035file, available at your nearest CPAN site.)
1036
1037Perl implements a class using a package, but the presence of a
1038package doesn't imply the presence of a class. A package is just a
1039namespace. A class is a package that provides subroutines that can be
1040used as methods. A method is just a subroutine that expects, as its
1041first argument, either the name of a package (for "static" methods),
1042or a reference to something (for "virtual" methods).
1043
1044A module is a file that (by convention) provides a class of the same
1045name (sans the .pm), plus an import method in that class that can be
1046called to fetch exported symbols. This module may implement some of
1047its methods by loading dynamic C or C++ objects, but that should be
1048totally transparent to the user of the module. Likewise, the module
1049might set up an AUTOLOAD function to slurp in subroutine definitions on
1050demand, but this is also transparent. Only the F<.pm> file is required to
82e1c0d9 1051exist. See L<perlsub>, L<perlobj>, and L<AutoLoader> for details about
2e1d04bc
JH
1052the AUTOLOAD mechanism.
1053
1054=head2 Guidelines for Module Creation
1055
1056=over 4
1057
ac634a9a
JH
1058=item *
1059
1060Do similar modules already exist in some form?
2e1d04bc
JH
1061
1062If so, please try to reuse the existing modules either in whole or
1063by inheriting useful features into a new class. If this is not
1064practical try to get together with the module authors to work on
1065extending or enhancing the functionality of the existing modules.
1066A perfect example is the plethora of packages in perl4 for dealing
1067with command line options.
1068
1069If you are writing a module to expand an already existing set of
1070modules, please coordinate with the author of the package. It
1071helps if you follow the same naming scheme and module interaction
1072scheme as the original author.
1073
ac634a9a
JH
1074=item *
1075
1076Try to design the new module to be easy to extend and reuse.
2e1d04bc
JH
1077
1078Try to C<use warnings;> (or C<use warnings qw(...);>).
1079Remember that you can add C<no warnings qw(...);> to individual blocks
1080of code that need less warnings.
1081
1082Use blessed references. Use the two argument form of bless to bless
1083into the class name given as the first parameter of the constructor,
1084e.g.,:
1085
1086 sub new {
1087 my $class = shift;
1088 return bless {}, $class;
1089 }
1090
1091or even this if you'd like it to be used as either a static
1092or a virtual method.
1093
1094 sub new {
1095 my $self = shift;
1096 my $class = ref($self) || $self;
1097 return bless {}, $class;
1098 }
1099
1100Pass arrays as references so more parameters can be added later
1101(it's also faster). Convert functions into methods where
1102appropriate. Split large methods into smaller more flexible ones.
1103Inherit methods from other modules if appropriate.
1104
1105Avoid class name tests like: C<die "Invalid" unless ref $ref eq 'FOO'>.
1106Generally you can delete the C<eq 'FOO'> part with no harm at all.
1107Let the objects look after themselves! Generally, avoid hard-wired
1108class names as far as possible.
1109
1110Avoid C<< $r->Class::func() >> where using C<@ISA=qw(... Class ...)> and
82e1c0d9 1111C<< $r->func() >> would work.
2e1d04bc
JH
1112
1113Use autosplit so little used or newly added functions won't be a
1114burden to programs that don't use them. Add test functions to
1115the module after __END__ either using AutoSplit or by saying:
1116
1117 eval join('',<main::DATA>) || die $@ unless caller();
1118
1119Does your module pass the 'empty subclass' test? If you say
1120C<@SUBCLASS::ISA = qw(YOURCLASS);> your applications should be able
1121to use SUBCLASS in exactly the same way as YOURCLASS. For example,
63acfd00 1122does your application still work if you change: C<< $obj = YOURCLASS->new(); >>
1123into: C<< $obj = SUBCLASS->new(); >> ?
2e1d04bc
JH
1124
1125Avoid keeping any state information in your packages. It makes it
1126difficult for multiple other packages to use yours. Keep state
1127information in objects.
1128
1129Always use B<-w>.
1130
1131Try to C<use strict;> (or C<use strict qw(...);>).
1132Remember that you can add C<no strict qw(...);> to individual blocks
1133of code that need less strictness.
1134
1135Always use B<-w>.
1136
ba555bf5 1137Follow the guidelines in L<perlstyle>.
2e1d04bc
JH
1138
1139Always use B<-w>.
1140
ac634a9a
JH
1141=item *
1142
1143Some simple style guidelines
2e1d04bc
JH
1144
1145The perlstyle manual supplied with Perl has many helpful points.
1146
1147Coding style is a matter of personal taste. Many people evolve their
1148style over several years as they learn what helps them write and
1149maintain good code. Here's one set of assorted suggestions that
1150seem to be widely used by experienced developers:
1151
1152Use underscores to separate words. It is generally easier to read
1153$var_names_like_this than $VarNamesLikeThis, especially for
1154non-native speakers of English. It's also a simple rule that works
1155consistently with VAR_NAMES_LIKE_THIS.
1156
1157Package/Module names are an exception to this rule. Perl informally
1158reserves lowercase module names for 'pragma' modules like integer
1159and strict. Other modules normally begin with a capital letter and
1160use mixed case with no underscores (need to be short and portable).
1161
1162You may find it helpful to use letter case to indicate the scope
1163or nature of a variable. For example:
1164
1165 $ALL_CAPS_HERE constants only (beware clashes with Perl vars)
1166 $Some_Caps_Here package-wide global/static
1167 $no_caps_here function scope my() or local() variables
1168
1169Function and method names seem to work best as all lowercase.
1170e.g., C<< $obj->as_string() >>.
1171
1172You can use a leading underscore to indicate that a variable or
1173function should not be used outside the package that defined it.
1174
ac634a9a
JH
1175=item *
1176
1177Select what to export.
2e1d04bc
JH
1178
1179Do NOT export method names!
1180
1181Do NOT export anything else by default without a good reason!
1182
1183Exports pollute the namespace of the module user. If you must
1184export try to use @EXPORT_OK in preference to @EXPORT and avoid
1185short or common names to reduce the risk of name clashes.
1186
1187Generally anything not exported is still accessible from outside the
1188module using the ModuleName::item_name (or C<< $blessed_ref->method >>)
1189syntax. By convention you can use a leading underscore on names to
1190indicate informally that they are 'internal' and not for public use.
1191
1192(It is actually possible to get private functions by saying:
1193C<my $subref = sub { ... }; &$subref;>. But there's no way to call that
1194directly as a method, because a method must have a name in the symbol
1195table.)
1196
1197As a general rule, if the module is trying to be object oriented
1198then export nothing. If it's just a collection of functions then
1199@EXPORT_OK anything but use @EXPORT with caution.
1200
ac634a9a
JH
1201=item *
1202
1203Select a name for the module.
2e1d04bc
JH
1204
1205This name should be as descriptive, accurate, and complete as
1206possible. Avoid any risk of ambiguity. Always try to use two or
1207more whole words. Generally the name should reflect what is special
1208about what the module does rather than how it does it. Please use
1209nested module names to group informally or categorize a module.
1210There should be a very good reason for a module not to have a nested name.
1211Module names should begin with a capital letter.
1212
1213Having 57 modules all called Sort will not make life easy for anyone
1214(though having 23 called Sort::Quick is only marginally better :-).
1215Imagine someone trying to install your module alongside many others.
1216If in any doubt ask for suggestions in comp.lang.perl.misc.
1217
1218If you are developing a suite of related modules/classes it's good
1219practice to use nested classes with a common prefix as this will
1220avoid namespace clashes. For example: Xyz::Control, Xyz::View,
1221Xyz::Model etc. Use the modules in this list as a naming guide.
1222
1223If adding a new module to a set, follow the original author's
1224standards for naming modules and the interface to methods in
1225those modules.
1226
4844a3be
SP
1227If developing modules for private internal or project specific use,
1228that will never be released to the public, then you should ensure
1229that their names will not clash with any future public module. You
1230can do this either by using the reserved Local::* category or by
1231using a category name that includes an underscore like Foo_Corp::*.
1232
2e1d04bc
JH
1233To be portable each component of a module name should be limited to
123411 characters. If it might be used on MS-DOS then try to ensure each is
1235unique in the first 8 characters. Nested modules make this easier.
1236
ac634a9a
JH
1237=item *
1238
1239Have you got it right?
2e1d04bc
JH
1240
1241How do you know that you've made the right decisions? Have you
1242picked an interface design that will cause problems later? Have
1243you picked the most appropriate name? Do you have any questions?
1244
1245The best way to know for sure, and pick up many helpful suggestions,
1246is to ask someone who knows. Comp.lang.perl.misc is read by just about
1247all the people who develop modules and it's the best place to ask.
1248
1249All you need to do is post a short summary of the module, its
1250purpose and interfaces. A few lines on each of the main methods is
1251probably enough. (If you post the whole module it might be ignored
1252by busy people - generally the very people you want to read it!)
1253
1254Don't worry about posting if you can't say when the module will be
1255ready - just say so in the message. It might be worth inviting
1256others to help you, they may be able to complete it for you!
1257
ac634a9a
JH
1258=item *
1259
1260README and other Additional Files.
2e1d04bc
JH
1261
1262It's well known that software developers usually fully document the
1263software they write. If, however, the world is in urgent need of
1264your software and there is not enough time to write the full
1265documentation please at least provide a README file containing:
1266
1267=over 10
1268
1269=item *
ac634a9a 1270
2e1d04bc
JH
1271A description of the module/package/extension etc.
1272
1273=item *
ac634a9a 1274
2e1d04bc
JH
1275A copyright notice - see below.
1276
1277=item *
ac634a9a 1278
2e1d04bc
JH
1279Prerequisites - what else you may need to have.
1280
1281=item *
ac634a9a 1282
2e1d04bc
JH
1283How to build it - possible changes to Makefile.PL etc.
1284
1285=item *
ac634a9a 1286
2e1d04bc
JH
1287How to install it.
1288
1289=item *
ac634a9a 1290
2e1d04bc
JH
1291Recent changes in this release, especially incompatibilities
1292
1293=item *
ac634a9a 1294
2e1d04bc
JH
1295Changes / enhancements you plan to make in the future.
1296
1297=back
1298
1299If the README file seems to be getting too large you may wish to
1300split out some of the sections into separate files: INSTALL,
1301Copying, ToDo etc.
1302
1303=over 4
1304
c165c82a 1305=item *
2e1d04bc 1306
c165c82a 1307Adding a Copyright Notice.
ac634a9a 1308
2e1d04bc
JH
1309How you choose to license your work is a personal decision.
1310The general mechanism is to assert your Copyright and then make
1311a declaration of how others may copy/use/modify your work.
1312
2a551100
JH
1313Perl, for example, is supplied with two types of licence: The GNU GPL
1314and The Artistic Licence (see the files README, Copying, and Artistic,
1315or L<perlgpl> and L<perlartistic>). Larry has good reasons for NOT
1316just using the GNU GPL.
2e1d04bc
JH
1317
1318My personal recommendation, out of respect for Larry, Perl, and the
1319Perl community at large is to state something simply like:
1320
1321 Copyright (c) 1995 Your Name. All rights reserved.
1322 This program is free software; you can redistribute it and/or
1323 modify it under the same terms as Perl itself.
1324
1325This statement should at least appear in the README file. You may
1326also wish to include it in a Copying file and your source files.
1327Remember to include the other words in addition to the Copyright.
1328
ac634a9a
JH
1329=item *
1330
1331Give the module a version/issue/release number.
2e1d04bc
JH
1332
1333To be fully compatible with the Exporter and MakeMaker modules you
1334should store your module's version number in a non-my package
f39335f9 1335variable called $VERSION. This should be a positive floating point
2e1d04bc
JH
1336number with at least two digits after the decimal (i.e., hundredths,
1337e.g, C<$VERSION = "0.01">). Don't use a "1.3.2" style version.
1338See L<Exporter> for details.
1339
1340It may be handy to add a function or method to retrieve the number.
1341Use the number in announcements and archive file names when
1342releasing the module (ModuleName-1.02.tar.Z).
1343See perldoc ExtUtils::MakeMaker.pm for details.
1344
ac634a9a
JH
1345=item *
1346
1347How to release and distribute a module.
2e1d04bc
JH
1348
1349It's good idea to post an announcement of the availability of your
1350module (or the module itself if small) to the comp.lang.perl.announce
1351Usenet newsgroup. This will at least ensure very wide once-off
1352distribution.
1353
1354If possible, register the module with CPAN. You should
1355include details of its location in your announcement.
1356
1357Some notes about ftp archives: Please use a long descriptive file
1358name that includes the version number. Most incoming directories
1359will not be readable/listable, i.e., you won't be able to see your
1360file after uploading it. Remember to send your email notification
1361message as soon as possible after uploading else your file may get
1362deleted automatically. Allow time for the file to be processed
1363and/or check the file has been processed before announcing its
1364location.
1365
1366FTP Archives for Perl Modules:
1367
1368Follow the instructions and links on:
1369
4e860d0a
JH
1370 http://www.cpan.org/modules/00modlist.long.html
1371 http://www.cpan.org/modules/04pause.html
2e1d04bc
JH
1372
1373or upload to one of these sites:
1374
1375 https://pause.kbx.de/pause/
e59066d8 1376 http://pause.perl.org/
2e1d04bc
JH
1377
1378and notify <modules@perl.org>.
1379
1380By using the WWW interface you can ask the Upload Server to mirror
1381your modules from your ftp or WWW site into your own directory on
1382CPAN!
1383
1384Please remember to send me an updated entry for the Module list!
1385
ac634a9a
JH
1386=item *
1387
1388Take care when changing a released module.
2e1d04bc
JH
1389
1390Always strive to remain compatible with previous released versions.
1391Otherwise try to add a mechanism to revert to the
1392old behavior if people rely on it. Document incompatible changes.
1393
1394=back
1395
abf06cc1
MS
1396=back
1397
2e1d04bc
JH
1398=head2 Guidelines for Converting Perl 4 Library Scripts into Modules
1399
1400=over 4
1401
ac634a9a
JH
1402=item *
1403
1404There is no requirement to convert anything.
2e1d04bc
JH
1405
1406If it ain't broke, don't fix it! Perl 4 library scripts should
1407continue to work with no problems. You may need to make some minor
1408changes (like escaping non-array @'s in double quoted strings) but
1409there is no need to convert a .pl file into a Module for just that.
1410
ac634a9a
JH
1411=item *
1412
1413Consider the implications.
2e1d04bc
JH
1414
1415All Perl applications that make use of the script will need to
1416be changed (slightly) if the script is converted into a module. Is
1417it worth it unless you plan to make other changes at the same time?
1418
ac634a9a
JH
1419=item *
1420
1421Make the most of the opportunity.
2e1d04bc
JH
1422
1423If you are going to convert the script to a module you can use the
1424opportunity to redesign the interface. The guidelines for module
1425creation above include many of the issues you should consider.
1426
ac634a9a
JH
1427=item *
1428
1429The pl2pm utility will get you started.
2e1d04bc
JH
1430
1431This utility will read *.pl files (given as parameters) and write
1432corresponding *.pm files. The pl2pm utilities does the following:
1433
1434=over 10
1435
1436=item *
ac634a9a 1437
2e1d04bc
JH
1438Adds the standard Module prologue lines
1439
1440=item *
ac634a9a 1441
2e1d04bc
JH
1442Converts package specifiers from ' to ::
1443
1444=item *
ac634a9a 1445
2e1d04bc
JH
1446Converts die(...) to croak(...)
1447
1448=item *
ac634a9a 1449
2e1d04bc
JH
1450Several other minor changes
1451
1452=back
1453
1454Being a mechanical process pl2pm is not bullet proof. The converted
1455code will need careful checking, especially any package statements.
1456Don't delete the original .pl file till the new .pm one works!
1457
1458=back
1459
1460=head2 Guidelines for Reusing Application Code
1461
1462=over 4
1463
ac634a9a
JH
1464=item *
1465
1466Complete applications rarely belong in the Perl Module Library.
1467
1468=item *
2e1d04bc 1469
ac634a9a 1470Many applications contain some Perl code that could be reused.
2e1d04bc
JH
1471
1472Help save the world! Share your code in a form that makes it easy
1473to reuse.
1474
ac634a9a
JH
1475=item *
1476
1477Break-out the reusable code into one or more separate module files.
1478
1479=item *
1480
1481Take the opportunity to reconsider and redesign the interfaces.
2e1d04bc 1482
ac634a9a 1483=item *
2e1d04bc 1484
ac634a9a 1485In some cases the 'application' can then be reduced to a small
2e1d04bc
JH
1486
1487fragment of code built on top of the reusable modules. In these cases
1488the application could invoked as:
1489
1490 % perl -e 'use Module::Name; method(@ARGV)' ...
1491or
1492 % perl -mModule::Name ... (in perl5.002 or higher)
1493
1494=back
1495
1496=head1 NOTE
1497
1498Perl does not enforce private and public parts of its modules as you may
1499have been used to in other languages like C++, Ada, or Modula-17. Perl
1500doesn't have an infatuation with enforced privacy. It would prefer
1501that you stayed out of its living room because you weren't invited, not
1502because it has a shotgun.
1503
1504The module and its user have a contract, part of which is common law,
1505and part of which is "written". Part of the common law contract is
1506that a module doesn't pollute any namespace it wasn't asked to. The
1507written contract for the module (A.K.A. documentation) may make other
1508provisions. But then you know when you C<use RedefineTheWorld> that
1509you're redefining the world and willing to take the consequences.
d72ea276
NC
1510
1511=cut
2e1d04bc
JH
1512
1513close MANIFEST or warn "$0: failed to close MANIFEST (../MANIFEST): $!";
b7da254d 1514close OUT or warn "$0: failed to close OUT (perlmodlib.pod): $!";
2e1d04bc 1515