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