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