Regen perlapi, regen toc.
[p5sagit/p5-mst-13.2.git] / pod / perlmodlib.pod
1 =for maintainers
2 Generated by perlmodlib.PL -- DO NOT EDIT!
3
4 =head1 NAME
5
6 perlmodlib - constructing new Perl modules and finding existing ones
7
8 =head1 DESCRIPTION
9
10 =head1 THE PERL MODULE LIBRARY
11
12 Many modules are included the Perl distribution.  These are described
13 below, and all end in F<.pm>.  You may discover compiled library
14 file (usually ending in F<.so>) or small pieces of modules to be
15 autoloaded (ending in F<.al>); these were automatically generated
16 by the installation process.  You may also discover files in the
17 library directory that end in either F<.pl> or F<.ph>.  These are
18 old libraries supplied so that old programs that use them still
19 run.  The F<.pl> files will all eventually be converted into standard
20 modules, and the F<.ph> files made by B<h2ph> will probably end up
21 as extension modules made by B<h2xs>.  (Some F<.ph> values may
22 already be available through the POSIX, Errno, or Fcntl modules.)
23 The B<pl2pm> file in the distribution may help in your conversion,
24 but it's just a mechanical process and therefore far from bulletproof.
25
26 =head2 Pragmatic Modules
27
28 They work somewhat like compiler directives (pragmata) in that they
29 tend to affect the compilation of your program, and thus will usually
30 work well only when used within a C<use>, or C<no>.  Most of these
31 are lexically scoped, so an inner BLOCK may countermand them
32 by saying:
33
34     no integer;
35     no strict 'refs';
36     no warnings;
37
38 which lasts until the end of that BLOCK.
39
40 Some pragmas are lexically scoped--typically those that affect the
41 C<$^H> hints variable.  Others affect the current package instead,
42 like C<use vars> and C<use subs>, which allow you to predeclare a
43 variables or subroutines within a particular I<file> rather than
44 just a block.  Such declarations are effective for the entire file
45 for which they were declared.  You cannot rescind them with C<no
46 vars> or C<no subs>.
47
48 The following pragmas are defined (and have their own documentation).
49
50 =over 12
51
52 =item attributes
53
54 Get/set subroutine or variable attributes
55
56 =item attrs
57
58 Set/get attributes of a subroutine (deprecated)
59
60 =item autouse
61
62 Postpone load of modules until a function is used
63
64 =item base
65
66 Establish IS-A relationship with base class at compile time
67
68 =item blib
69
70 Use MakeMaker's uninstalled version of a package
71
72 =item bytes
73
74 Force byte semantics rather than character semantics
75
76 =item charnames
77
78 Define character names for C<\N{named}> string literal escapes.
79
80 =item constant
81
82 Declare constants
83
84 =item diagnostics
85
86 Perl compiler pragma to force verbose warning diagnostics
87
88 =item encoding
89
90 Pragma to control the conversion of legacy data into Unicode
91
92 =item fields
93
94 Compile-time class fields
95
96 =item filetest
97
98 Control the filetest permission operators
99
100 =item integer
101
102 Use integer arithmetic instead of floating point
103
104 =item less
105
106 Request less of something from the compiler
107
108 =item locale
109
110 Use and avoid POSIX locales for built-in operations
111
112 =item open
113
114 Set default disciplines for input and output
115
116 =item ops
117
118 Restrict unsafe operations when compiling
119
120 =item overload
121
122 Package for overloading perl operations
123
124 =item re
125
126 Alter regular expression behaviour
127
128 =item sigtrap
129
130 Enable simple signal handling
131
132 =item sort
133
134 Control sort() behaviour
135
136 =item strict
137
138 Restrict unsafe constructs
139
140 =item subs
141
142 Predeclare sub names
143
144 =item threads
145
146 Perl extension allowing use of interpreter based threads from perl
147
148 =item utf8
149
150 Enable/disable UTF-8 (or UTF-EBCDIC) in source code
151
152 =item vars
153
154 Predeclare global variable names (obsolete)
155
156 =item vmsish
157
158 Control VMS-specific language features
159
160 =item warnings
161
162 Control optional warnings
163
164 =item warnings::register
165
166 Warnings import function
167
168 =back
169
170 =head2 Standard Modules
171
172 Standard, bundled modules are all expected to behave in a well-defined
173 manner with respect to namespace pollution because they use the
174 Exporter module.  See their own documentation for details.
175
176 =over 12
177
178 =item AnyDBM_File
179
180 Provide framework for multiple DBMs
181
182 =item Attribute::Handlers
183
184 Simpler definition of attribute handlers
185
186 =item AutoLoader
187
188 Load subroutines only on demand
189
190 =item AutoSplit
191
192 Split a package for autoloading
193
194 =item B
195
196 The Perl Compiler
197
198 =item B::Asmdata
199
200 Autogenerated data about Perl ops, used to generate bytecode
201
202 =item B::Assembler
203
204 Assemble Perl bytecode
205
206 =item B::Bblock
207
208 Walk basic blocks
209
210 =item B::Bytecode
211
212 Perl compiler's bytecode backend
213
214 =item B::C
215
216 Perl compiler's C backend
217
218 =item B::CC
219
220 Perl compiler's optimized C translation backend
221
222 =item B::Concise
223
224 Walk Perl syntax tree, printing concise info about ops
225
226 =item B::Debug
227
228 Walk Perl syntax tree, printing debug info about ops
229
230 =item B::Deparse
231
232 Perl compiler backend to produce perl code
233
234 =item B::Disassembler
235
236 Disassemble Perl bytecode
237
238 =item B::Lint
239
240 Perl lint
241
242 =item B::Showlex
243
244 Show lexical variables used in functions or files
245
246 =item B::Stackobj
247
248 Helper module for CC backend
249
250 =item B::Stash
251
252 Show what stashes are loaded
253
254 =item B::Terse
255
256 Walk Perl syntax tree, printing terse info about ops
257
258 =item B::Xref
259
260 Generates cross reference reports for Perl programs
261
262 =item Benchmark
263
264 Benchmark running times of Perl code
265
266 =item ByteLoader
267
268 Load byte compiled perl code
269
270 =item CGI
271
272 Simple Common Gateway Interface Class
273
274 =item CGI::Apache
275
276 Backward compatibility module for CGI.pm
277
278 =item CGI::Carp
279
280 CGI routines for writing to the HTTPD (or other) error log
281
282 =item CGI::Cookie
283
284 Interface to Netscape Cookies
285
286 =item CGI::Fast
287
288 CGI Interface for Fast CGI
289
290 =item CGI::Pretty
291
292 Module to produce nicely formatted HTML code
293
294 =item CGI::Push
295
296 Simple Interface to Server Push
297
298 =item CGI::Switch
299
300 Backward compatibility module for defunct CGI::Switch
301
302 =item CGI::Util
303
304 Internal utilities used by CGI module
305
306 =item CPAN
307
308 Query, download and build perl modules from CPAN sites
309
310 =item CPAN::FirstTime
311
312 Utility for CPAN::Config file Initialization
313
314 =item CPAN::Nox
315
316 Wrapper around CPAN.pm without using any XS module
317
318 =item Carp
319
320 Warn of errors (from perspective of caller)
321
322 =item Carp::Heavy
323
324 No user serviceable parts inside
325
326 =item Class::ISA
327
328 Report the search path for a class's ISA tree
329
330 =item Class::Struct
331
332 Declare struct-like datatypes as Perl classes
333
334 =item Cwd
335
336 Get pathname of current working directory
337
338 =item DB
339
340 Programmatic interface to the Perl debugging API (draft, subject to
341
342 =item DB_File
343
344 Perl5 access to Berkeley DB version 1.x
345
346 =item Devel::SelfStubber
347
348 Generate stubs for a SelfLoading module
349
350 =item Digest
351
352 Modules that calculate message digests
353
354 =item DirHandle
355
356 Supply object methods for directory handles
357
358 =item Dumpvalue
359
360 Provides screen dump of Perl data.
361
362 =item Encode
363
364 Character encodings
365
366 =item Encode::EncodeFormat
367
368 The format of encoding tables of the Encode extension
369
370 =item Encode::Tcl
371
372 Tcl encodings
373
374 =item English
375
376 Use nice English (or awk) names for ugly punctuation variables
377
378 =item Env
379
380 Perl module that imports environment variables as scalars or arrays
381
382 =item Exporter
383
384 Implements default import method for modules
385
386 =item Exporter::Heavy
387
388 Exporter guts
389
390 =item ExtUtils::Command
391
392 Utilities to replace common UNIX commands in Makefiles etc.
393
394 =item ExtUtils::Constant
395
396 Generate XS code to import C header constants
397
398 =item ExtUtils::Embed
399
400 Utilities for embedding Perl in C/C++ applications
401
402 =item ExtUtils::Install
403
404 Install files from here to there
405
406 =item ExtUtils::Installed
407
408 Inventory management of installed modules
409
410 =item ExtUtils::Liblist
411
412 Determine libraries to use and how to use them
413
414 =item ExtUtils::MM_Cygwin
415
416 Methods to override UN*X behaviour in ExtUtils::MakeMaker
417
418 =item ExtUtils::MM_NW5
419
420 Methods to override UN*X behaviour in ExtUtils::MakeMaker
421
422 =item ExtUtils::MM_OS2
423
424 Methods to override UN*X behaviour in ExtUtils::MakeMaker
425
426 =item ExtUtils::MM_Unix
427
428 Methods used by ExtUtils::MakeMaker
429
430 =item ExtUtils::MM_VMS
431
432 Methods to override UN*X behaviour in ExtUtils::MakeMaker
433
434 =item ExtUtils::MM_Win32
435
436 Methods to override UN*X behaviour in ExtUtils::MakeMaker
437
438 =item ExtUtils::MakeMaker
439
440 Create an extension Makefile
441
442 =item ExtUtils::Manifest
443
444 Utilities to write and check a MANIFEST file
445
446 =item ExtUtils::Mkbootstrap
447
448 Make a bootstrap file for use by DynaLoader
449
450 =item ExtUtils::Mksymlists
451
452 Write linker options files for dynamic extension
453
454 =item ExtUtils::Packlist
455
456 Manage .packlist files
457
458 =item ExtUtils::testlib
459
460 Add blib/* directories to @INC
461
462 =item Fatal
463
464 Replace functions with equivalents which succeed or die
465
466 =item Fcntl
467
468 Load the C Fcntl.h defines
469
470 =item File::Basename
471
472 Split a pathname into pieces
473
474 =item File::CheckTree
475
476 Run many filetest checks on a tree
477
478 =item File::Compare
479
480 Compare files or filehandles
481
482 =item File::Copy
483
484 Copy files or filehandles
485
486 =item File::DosGlob
487
488 DOS like globbing and then some
489
490 =item File::Find
491
492 Traverse a file tree
493
494 =item File::Path
495
496 Create or remove directory trees
497
498 =item File::Spec
499
500 Portably perform operations on file names
501
502 =item File::Spec::Epoc
503
504 Methods for Epoc file specs
505
506 =item File::Spec::Functions
507
508 Portably perform operations on file names
509
510 =item File::Spec::Mac
511
512 File::Spec for Mac OS (Classic)
513
514 =item File::Spec::OS2
515
516 Methods for OS/2 file specs
517
518 =item File::Spec::Unix
519
520 File::Spec for Unix, base for other File::Spec modules
521
522 =item File::Spec::VMS
523
524 Methods for VMS file specs
525
526 =item File::Spec::Win32
527
528 Methods for Win32 file specs
529
530 =item File::Temp
531
532 Return name and handle of a temporary file safely
533
534 =item File::stat
535
536 By-name interface to Perl's built-in stat() functions
537
538 =item FileCache
539
540 Keep more files open than the system permits
541
542 =item FileHandle
543
544 Supply object methods for filehandles
545
546 =item Filter::Simple
547
548 Simplified source filtering
549
550 =item FindBin
551
552 Locate directory of original perl script
553
554 =item Getopt::Long
555
556 Extended processing of command line options
557
558 =item Getopt::Std
559
560 Process single-character switches with switch clustering
561
562 =item I18N::Collate
563
564 Compare 8-bit scalar data according to the current locale
565
566 =item I18N::LangTags
567
568 Functions for dealing with RFC3066-style language tags
569
570 =item I18N::LangTags::List
571
572 Tags and names for human languages
573
574 =item IO
575
576 Load various IO modules
577
578 =item IPC::Open2
579
580 Open a process for both reading and writing
581
582 =item IPC::Open3
583
584 Open a process for reading, writing, and error handling
585
586 =item Locale::Constants
587
588 Constants for Locale codes
589
590 =item Locale::Country
591
592 ISO codes for country identification (ISO 3166)
593
594 =item Locale::Currency
595
596 ISO three letter codes for currency identification (ISO 4217)
597
598 =item Locale::Language
599
600 ISO two letter codes for language identification (ISO 639)
601
602 =item Locale::Maketext
603
604 Framework for localization
605
606 =item Locale::Maketext::TPJ13
607
608 Article about software localization
609
610 =item Math::BigFloat
611
612 Arbitrary size floating point math package
613
614 =item Math::BigInt
615
616 Arbitrary size integer math package
617
618 =item Math::BigInt::Calc
619
620 Pure Perl module to support Math::BigInt
621
622 =item Math::Complex
623
624 Complex numbers and associated mathematical functions
625
626 =item Math::Trig
627
628 Trigonometric functions
629
630 =item Memoize
631
632 Make your functions faster by trading space for time
633
634 =item Memoize::AnyDBM_File
635
636 Glue to provide EXISTS for AnyDBM_File for Storable use
637
638 =item Memoize::Expire
639
640 Plug-in module for automatic expiration of memoized values
641
642 =item Memoize::ExpireFile
643
644 Test for Memoize expiration semantics
645
646 =item Memoize::ExpireTest
647
648 Test for Memoize expiration semantics
649
650 =item Memoize::NDBM_File
651
652 Glue to provide EXISTS for NDBM_File for Storable use
653
654 =item Memoize::SDBM_File
655
656 Glue to provide EXISTS for SDBM_File for Storable use
657
658 =item Memoize::Saves
659
660 Plug-in module to specify which return values should be memoized
661
662 =item Memoize::Storable
663
664 Store Memoized data in Storable database
665
666 =item NDBM_File
667
668 Tied access to ndbm files
669
670 =item NEXT
671
672 Provide a pseudo-class NEXT that allows method redispatch
673
674 =item Net::Cmd
675
676 Network Command class (as used by FTP, SMTP etc)
677
678 =item Net::Config
679
680 Local configuration data for libnet
681
682 =item Net::Domain
683
684 Attempt to evaluate the current host's internet name and domain
685
686 =item Net::FTP
687
688 FTP Client class
689
690 =item Net::NNTP
691
692 NNTP Client class
693
694 =item Net::Netrc
695
696 OO interface to users netrc file
697
698 =item Net::POP3
699
700 Post Office Protocol 3 Client class (RFC1081)
701
702 =item Net::Ping
703
704 Check a remote host for reachability
705
706 =item Net::SMTP
707
708 Simple Mail Transfer Protocol Client
709
710 =item Net::Time
711
712 Time and daytime network client interface
713
714 =item Net::hostent
715
716 By-name interface to Perl's built-in gethost*() functions
717
718 =item Net::libnetFAQ
719
720 Libnet Frequently Asked Questions
721
722 =item Net::netent
723
724 By-name interface to Perl's built-in getnet*() functions
725
726 =item Net::protoent
727
728 By-name interface to Perl's built-in getproto*() functions
729
730 =item Net::servent
731
732 By-name interface to Perl's built-in getserv*() functions
733
734 =item O
735
736 Generic interface to Perl Compiler backends
737
738 =item ODBM_File
739
740 Tied access to odbm files
741
742 =item Opcode
743
744 Disable named opcodes when compiling perl code
745
746 =item POSIX
747
748 Perl interface to IEEE Std 1003.1
749
750 =item PerlIO
751
752 On demand loader for PerlIO layers and root of PerlIO::* name space
753
754 =item Pod::Checker
755
756 Check pod documents for syntax errors
757
758 =item Pod::Find
759
760 Find POD documents in directory trees
761
762 =item Pod::Html
763
764 Module to convert pod files to HTML
765
766 =item Pod::InputObjects
767
768 Objects representing POD input paragraphs, commands, etc.
769
770 =item Pod::LaTeX
771
772 Convert Pod data to formatted Latex
773
774 =item Pod::Man
775
776 Convert POD data to formatted *roff input
777
778 =item Pod::ParseLink
779
780 Parse an LE<lt>E<gt> formatting code in POD text
781
782 =item Pod::ParseUtils
783
784 Helpers for POD parsing and conversion
785
786 =item Pod::Parser
787
788 Base class for creating POD filters and translators
789
790 =item Pod::Plainer
791
792 Perl extension for converting Pod to old style Pod.
793
794 =item Pod::Select
795
796 Extract selected sections of POD from input
797
798 =item Pod::Text
799
800 Convert POD data to formatted ASCII text
801
802 =item Pod::Text::Color
803
804 Convert POD data to formatted color ASCII text
805
806 =item Pod::Text::Overstrike
807
808 Convert POD data to formatted overstrike text
809
810 =item Pod::Text::Termcap
811
812 Convert POD data to ASCII text with format escapes
813
814 =item Pod::Usage
815
816 Print a usage message from embedded pod documentation
817
818 =item Pod::t::basic
819
820 Test of various basic POD features in translators.
821
822 =item SDBM_File
823
824 Tied access to sdbm files
825
826 =item Safe
827
828 Compile and execute code in restricted compartments
829
830 =item Search::Dict
831
832 Search for key in dictionary file
833
834 =item SelectSaver
835
836 Save and restore selected file handle
837
838 =item SelfLoader
839
840 Load functions only on demand
841
842 =item Shell
843
844 Run shell commands transparently within perl
845
846 =item Socket
847
848 Load the C socket.h defines and structure manipulators 
849
850 =item Storable
851
852 Persistency for perl data structures
853
854 =item Switch
855
856 A switch statement for Perl
857
858 =item Symbol
859
860 Manipulate Perl symbols and their names
861
862 =item Term::ANSIColor
863
864 Color screen output using ANSI escape sequences
865
866 =item Term::Cap
867
868 Perl termcap interface
869
870 =item Term::Complete
871
872 Perl word completion module
873
874 =item Term::ReadLine
875
876 Perl interface to various C<readline> packages. If
877
878 =item Test
879
880 Provides a simple framework for writing test scripts
881
882 =item Test::Builder
883
884 Backend for building test libraries
885
886 =item Test::Harness
887
888 Run perl standard test scripts with statistics
889
890 =item Test::More
891
892 Yet another framework for writing test scripts
893
894 =item Test::Simple
895
896 Basic utilities for writing tests.
897
898 =item Test::Tutorial
899
900 A tutorial about writing really basic tests
901
902 =item Text::Abbrev
903
904 Create an abbreviation table from a list
905
906 =item Text::Balanced
907
908 Extract delimited text sequences from strings.
909
910 =item Text::ParseWords
911
912 Parse text into an array of tokens or array of arrays
913
914 =item Text::Soundex
915
916 Implementation of the Soundex Algorithm as Described by Knuth
917
918 =item Text::Tabs
919
920 Expand and unexpand tabs per the unix expand(1) and unexpand(1)
921
922 =item Text::Wrap
923
924 Line wrapping to form simple paragraphs
925
926 =item Thread
927
928 Manipulate threads in Perl
929
930 =item Tie::Array
931
932 Base class for tied arrays
933
934 =item Tie::Handle
935
936 Base class definitions for tied handles
937
938 =item Tie::Hash
939
940 Base class definitions for tied hashes
941
942 =item Tie::RefHash
943
944 Use references as hash keys
945
946 =item Tie::Scalar
947
948 Base class definitions for tied scalars
949
950 =item Tie::SubstrHash
951
952 Fixed-table-size, fixed-key-length hashing
953
954 =item Time::Local
955
956 Efficiently compute time from local and GMT time
957
958 =item Time::gmtime
959
960 By-name interface to Perl's built-in gmtime() function
961
962 =item Time::localtime
963
964 By-name interface to Perl's built-in localtime() function
965
966 =item Time::tm
967
968 Internal object used by Time::gmtime and Time::localtime
969
970 =item UNIVERSAL
971
972 Base class for ALL classes (blessed references)
973
974 =item Unicode::Collate
975
976 Use UCA (Unicode Collation Algorithm)
977
978 =item Unicode::UCD
979
980 Unicode character database
981
982 =item User::grent
983
984 By-name interface to Perl's built-in getgr*() functions
985
986 =item User::pwent
987
988 By-name interface to Perl's built-in getpw*() functions
989
990 =item Win32
991
992 Interfaces to some Win32 API Functions
993
994 =back
995
996 To find out I<all> modules installed on your system, including
997 those without documentation or outside the standard release,
998 just do this:
999
1000     % find `perl -e 'print "@INC"'` -name '*.pm' -print
1001
1002 They should all have their own documentation installed and accessible
1003 via your system man(1) command.  If you do not have a B<find>
1004 program, you can use the Perl B<find2perl> program instead, which
1005 generates Perl code as output you can run through perl.  If you
1006 have a B<man> program but it doesn't find your modules, you'll have
1007 to fix your manpath.  See L<perl> for details.  If you have no
1008 system B<man> command, you might try the B<perldoc> program.
1009
1010 =head2 Extension Modules
1011
1012 Extension modules are written in C (or a mix of Perl and C).  They
1013 are usually dynamically loaded into Perl if and when you need them,
1014 but may also be linked in statically.  Supported extension modules
1015 include Socket, Fcntl, and POSIX.
1016
1017 Many popular C extension modules do not come bundled (at least, not
1018 completely) due to their sizes, volatility, or simply lack of time
1019 for adequate testing and configuration across the multitude of
1020 platforms on which Perl was beta-tested.  You are encouraged to
1021 look for them on CPAN (described below), or using web search engines
1022 like Alta Vista or Deja News.
1023
1024 =head1 CPAN
1025
1026 CPAN stands for Comprehensive Perl Archive Network; it's a globally
1027 replicated trove of Perl materials, including documentation, style
1028 guides, tricks and traps, alternate ports to non-Unix systems and
1029 occasional binary distributions for these.   Search engines for
1030 CPAN can be found at http://cpan.perl.com/ and at
1031 http://theory.uwinnipeg.ca/mod_perl/cpan-search.pl .
1032
1033 Most importantly, CPAN includes around a thousand unbundled modules,
1034 some of which require a C compiler to build.  Major categories of
1035 modules are:
1036
1037 =over
1038
1039 =item *
1040
1041 Language Extensions and Documentation Tools
1042
1043 =item *
1044
1045 Development Support
1046
1047 =item *
1048
1049 Operating System Interfaces
1050
1051 =item *
1052
1053 Networking, Device Control (modems) and InterProcess Communication
1054
1055 =item *
1056
1057 Data Types and Data Type Utilities
1058
1059 =item *
1060
1061 Database Interfaces
1062
1063 =item *
1064
1065 User Interfaces
1066
1067 =item *
1068
1069 Interfaces to / Emulations of Other Programming Languages
1070
1071 =item *
1072
1073 File Names, File Systems and File Locking (see also File Handles)
1074
1075 =item *
1076
1077 String Processing, Language Text Processing, Parsing, and Searching
1078
1079 =item *
1080
1081 Option, Argument, Parameter, and Configuration File Processing
1082
1083 =item *
1084
1085 Internationalization and Locale
1086
1087 =item *
1088
1089 Authentication, Security, and Encryption
1090
1091 =item *
1092
1093 World Wide Web, HTML, HTTP, CGI, MIME
1094
1095 =item *
1096
1097 Server and Daemon Utilities
1098
1099 =item *
1100
1101 Archiving and Compression
1102
1103 =item *
1104
1105 Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing
1106
1107 =item *
1108
1109 Mail and Usenet News
1110
1111 =item *
1112
1113 Control Flow Utilities (callbacks and exceptions etc)
1114
1115 =item *
1116
1117 File Handle and Input/Output Stream Utilities
1118
1119 =item *
1120
1121 Miscellaneous Modules
1122
1123 =back
1124
1125 Registered CPAN sites as of this writing include the following.
1126 You should try to choose one close to you:
1127
1128 =head2 Africa
1129
1130 =over 4
1131
1132 =item *
1133
1134 South Africa
1135
1136     ftp://ftp.is.co.za/programming/perl/CPAN/
1137     ftp://ftp.mweb.co.za/pub/mirrors/cpan/
1138     ftp://ftp.saix.net/pub/CPAN/
1139     ftp://ftp.sun.ac.za/CPAN/
1140
1141 =back
1142
1143 =head2 Asia
1144
1145 =over 4
1146
1147 =item *
1148
1149 China
1150
1151     ftp://freesoft.cei.gov.cn/pub/languages/perl/CPAN/
1152     http://www2.linuxforum.net/mirror/CPAN/
1153     http://CPAN.pacific.net.hk/
1154     ftp://ftp.pacific.net.hk/pub/mirror/CPAN/
1155     http://cpan.shellhung.org/
1156     ftp://ftp.shellhung.org/pub/CPAN
1157
1158 =item *
1159
1160 India
1161
1162     http://cpan.in.freeos.com
1163     ftp://cpan.in.freeos.com/pub/CPAN/
1164
1165 =item *
1166
1167 Indonesia
1168
1169     http://cpan.itb.web.id/
1170     ftp://mirrors.piksi.itb.ac.id/CPAN/
1171     http://CPAN.mweb.co.id/
1172     ftp://ftp.mweb.co.id/pub/languages/perl/CPAN/
1173
1174 =item *
1175
1176 Israel
1177
1178     http://www.iglu.org.il:/pub/CPAN/
1179     ftp://ftp.iglu.org.il/pub/CPAN/
1180     http://cpan.lerner.co.il/
1181     http://bioinfo.weizmann.ac.il/pub/software/perl/CPAN/
1182     ftp://bioinfo.weizmann.ac.il/pub/software/perl/CPAN/
1183
1184 =item *
1185
1186 Japan
1187
1188     ftp://ftp.u-aizu.ac.jp/pub/CPAN
1189     ftp://ftp.kddlabs.co.jp/CPAN/
1190     http://mirror.nucba.ac.jp/mirror/Perl/
1191     ftp://mirror.nucba.ac.jp/mirror/Perl/
1192     ftp://ftp.meisei-u.ac.jp/pub/CPAN/
1193     ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
1194     ftp://ftp.dti.ad.jp/pub/lang/CPAN/
1195     ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
1196
1197 =item *
1198
1199 Korea
1200
1201     http://mirror.Mazic.org/pub/CPAN
1202     ftp://mirror.Mazic.org/pub/CPAN
1203
1204 =item *
1205
1206 Philippines
1207
1208     http://www.adzu.edu.ph/CPAN
1209
1210 =item *
1211
1212 Russian Federation
1213
1214     http://cpan.tomsk.ru
1215     ftp://cpan.tomsk.ru/pub/CPAN
1216
1217 =item *
1218
1219 Saudi Arabia
1220
1221     ftp://ftp.isu.net.sa/pub/CPAN/
1222
1223 =item *
1224
1225 Singapore
1226
1227     http://cpan.hjc.edu.sg
1228
1229 =item *
1230
1231 South Korea
1232
1233     http://CPAN.bora.net/
1234     ftp://ftp.bora.net/pub/CPAN/
1235     http://ftp.kornet.net/pub/CPAN/
1236     ftp://ftp.kornet.net/pub/CPAN/
1237     ftp://ftp.nuri.net/pub/CPAN/
1238
1239 =item *
1240
1241 Taiwan
1242
1243     ftp://coda.nctu.edu.tw/UNIX/perl/CPAN
1244     ftp://ftp.ee.ncku.edu.tw/pub/perl/CPAN/
1245     ftp://ftp1.sinica.edu.tw/pub1/perl/CPAN/
1246     http://ftp.tku.edu.tw/pub/CPAN/
1247     ftp://ftp.tku.edu.tw/pub/CPAN/
1248
1249 =item *
1250
1251 Thailand
1252
1253     http://download.nectec.or.th/CPAN/
1254     ftp://ftp.nectec.or.th/pub/languages/CPAN/
1255     ftp://ftp.cs.riubon.ac.th/pub/mirrors/CPAN/
1256
1257 =back
1258
1259 =head2 Central America
1260
1261 =over 4
1262
1263 =item *
1264
1265 Costa Rica
1266
1267     ftp://ftp.linux.co.cr/mirrors/CPAN/
1268     http://ftp.ucr.ac.cr/Unix/CPAN/
1269     ftp://ftp.ucr.ac.cr/pub/Unix/CPAN/
1270
1271 =back
1272
1273 =head2 Europe
1274
1275 =over 4
1276
1277 =item *
1278
1279 Austria
1280
1281     ftp://ftp.tuwien.ac.at/pub/CPAN/
1282
1283 =item *
1284
1285 Belgium
1286
1287     http://ftp.easynet.be/pub/CPAN/
1288     ftp://ftp.easynet.be/pub/CPAN/
1289     http://cpan.skynet.be
1290     ftp://ftp.skynet.be/pub/CPAN
1291     ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
1292
1293 =item *
1294
1295 Bulgaria
1296
1297     ftp://ftp.ntrl.net/pub/mirrors/CPAN/
1298
1299 =item *
1300
1301 Croatia
1302
1303     ftp://ftp.linux.hr/pub/CPAN/
1304
1305 =item *
1306
1307 Czech Republic
1308
1309     http://ftp.fi.muni.cz/pub/CPAN/
1310     ftp://ftp.fi.muni.cz/pub/CPAN/
1311     ftp://sunsite.mff.cuni.cz/MIRRORS/ftp.funet.fi/pub/languages/perl/CPAN/
1312
1313 =item *
1314
1315 Denmark
1316
1317     http://mirrors.sunsite.dk/cpan/
1318     ftp://sunsite.dk/mirrors/cpan/
1319     http://www.cpan.dk/CPAN/
1320     ftp://www.cpan.dk/ftp.cpan.org/CPAN/
1321
1322 =item *
1323
1324 England
1325
1326     http://www.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN
1327     ftp://ftp.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN/
1328     http://cpan.crazygreek.co.uk
1329     ftp://ftp.demon.co.uk/pub/CPAN/
1330     ftp://ftp.flirble.org/pub/languages/perl/CPAN/
1331     ftp://ftp.plig.org/pub/CPAN/
1332     ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
1333     http://mirror.uklinux.net/CPAN/
1334     ftp://mirror.uklinux.net/pub/CPAN/
1335     ftp://usit.shef.ac.uk/pub/packages/CPAN/
1336
1337 =item *
1338
1339 Estonia
1340
1341     ftp://ftp.ut.ee/pub/languages/perl/CPAN/
1342
1343 =item *
1344
1345 Finland
1346
1347     ftp://ftp.funet.fi/pub/languages/perl/CPAN/
1348     http://cpan.kpnqwest.fi/
1349
1350 =item *
1351
1352 France
1353
1354     ftp://cpan.ftp.worldonline.fr/pub/CPAN/
1355     http://cpan.mirrors.easynet.fr/
1356     ftp://cpan.mirrors.easynet.fr/pub/ftp.cpan.org/
1357     ftp://ftp.club-internet.fr/pub/perl/CPAN/
1358     http://fr.cpan.org/
1359     ftp://ftp.lip6.fr/pub/perl/CPAN/
1360     ftp://ftp.oleane.net/pub/mirrors/CPAN/
1361     ftp://ftp.pasteur.fr/pub/computing/CPAN/
1362     http://cpan.cict.fr/
1363     ftp://cpan.cict.fr/pub/CPAN/
1364     ftp://ftp.uvsq.fr/pub/perl/CPAN/
1365
1366 =item *
1367
1368 Germany
1369
1370     ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/
1371     ftp://ftp.freenet.de/pub/ftp.cpan.org/pub/CPAN/
1372     ftp://ftp.uni-erlangen.de/pub/source/CPAN/
1373     ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/CPAN
1374     ftp://ftp.gigabell.net/pub/CPAN/
1375     http://ftp.gwdg.de/pub/languages/perl/CPAN/
1376     ftp://ftp.gwdg.de/pub/languages/perl/CPAN/
1377     ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
1378     ftp://ftp.leo.org/pub/CPAN/
1379     http://cpan.noris.de/
1380     ftp://cpan.noris.de/pub/CPAN/
1381     ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
1382     ftp://ftp.gmd.de/mirrors/CPAN/
1383
1384 =item *
1385
1386 Greece
1387
1388     ftp://ftp.forthnet.gr/pub/languages/perl/CPAN
1389     ftp://ftp.ntua.gr/pub/lang/perl/
1390
1391 =item *
1392
1393 Hungary
1394
1395     http://cpan.artifact.hu/
1396     ftp://cpan.artifact.hu/CPAN/
1397     http://ftp.kfki.hu/pub/CPAN/
1398     ftp://ftp.kfki.hu/pub/CPAN/
1399
1400 =item *
1401
1402 Iceland
1403
1404     http://ftp.rhnet.is/pub/CPAN/
1405     ftp://ftp.rhnet.is/pub/CPAN/
1406
1407 =item *
1408
1409 Ireland
1410
1411     http://cpan.indigo.ie/
1412     ftp://cpan.indigo.ie/pub/CPAN/
1413     http://sunsite.compapp.dcu.ie/pub/perl/
1414     ftp://sunsite.compapp.dcu.ie/pub/perl/
1415
1416 =item *
1417
1418 Italy
1419
1420     http://cpan.nettuno.it/
1421     http://gusp.dyndns.org/CPAN/
1422     ftp://gusp.dyndns.org/pub/CPAN
1423     http://softcity.iol.it/cpan
1424     ftp://softcity.iol.it/pub/cpan
1425     ftp://ftp.unina.it/pub/Other/CPAN/
1426     ftp://ftp.unipi.it/pub/mirror/perl/CPAN/
1427     ftp://cis.uniRoma2.it/CPAN/
1428     ftp://ftp.edisontel.it/pub/CPAN_Mirror/
1429     ftp://ftp.flashnet.it/pub/CPAN/
1430
1431 =item *
1432
1433 Latvia
1434
1435     http://kvin.lv/pub/CPAN/
1436
1437 =item *
1438
1439 Lithuania
1440
1441     ftp://ftp.unix.lt/pub/CPAN/
1442
1443 =item *
1444
1445 Netherlands
1446
1447     ftp://download.xs4all.nl/pub/mirror/CPAN/
1448     ftp://ftp.nl.uu.net/pub/CPAN/
1449     ftp://ftp.nluug.nl/pub/languages/perl/CPAN/
1450     http://cpan.cybercomm.nl/
1451     ftp://mirror.cybercomm.nl/pub/cpan/
1452     ftp://ftp.cpan.nl/pub/CPAN/
1453     http://www.cs.uu.nl/mirror/CPAN/
1454     ftp://ftp.cs.uu.nl/mirror/CPAN/
1455
1456 =item *
1457
1458 Norway
1459
1460     ftp://ftp.uninett.no/pub/languages/perl/CPAN
1461     ftp://ftp.uit.no/pub/languages/perl/cpan/
1462
1463 =item *
1464
1465 Poland
1466
1467     ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
1468     http://www.fic.uni.lodz.pl/pub/CPAN
1469     ftp://ftp.fic.uni.lodz.pl/pub/CPAN
1470     ftp://ftp.mega.net.pl/pub/mirrors/ftp.perl.com/
1471     ftp://ftp.man.torun.pl/pub/doc/CPAN/
1472     ftp://sunsite.icm.edu.pl/pub/CPAN/
1473
1474 =item *
1475
1476 Portugal
1477
1478     ftp://ftp.ua.pt/pub/CPAN/
1479     ftp://perl.di.uminho.pt/pub/CPAN/
1480     http://cpan.ip.pt/
1481     ftp://cpan.ip.pt/pub/perl/
1482     ftp://ftp.ist.utl.pt/pub/CPAN/
1483     http://cpan.ip.pt/
1484     ftp://cpan.ip.pt/pub/cpan/
1485     ftp://ftp.netc.pt/pub/CPAN/
1486     ftp://ftp.up.pt/pub/CPAN
1487
1488 =item *
1489
1490 Romania
1491
1492     ftp://archive.logicnet.ro/mirrors/ftp.cpan.org/CPAN/
1493     ftp://ftp.kappa.ro/pub/mirrors/ftp.perl.org/pub/CPAN/
1494     ftp://ftp.dntis.ro/pub/cpan/
1495     ftp://ftp.opsynet.com/cpan/
1496     ftp://ftp.dnttm.ro/pub/CPAN/
1497     ftp://ftp.lasting.ro/pub/CPAN
1498     ftp://ftp.timisoara.roedu.net/mirrors/CPAN/
1499
1500 =item *
1501
1502 Russia
1503
1504     ftp://ftp.chg.ru/pub/lang/perl/CPAN/
1505     http://cpan.rinet.ru/
1506     ftp://cpan.rinet.ru/pub/mirror/CPAN/
1507     ftp://ftp.aha.ru/pub/CPAN/
1508     http://cpan.sai.msu.ru/
1509     ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
1510
1511 =item *
1512
1513 Slovakia
1514
1515     ftp://ftp.entry.sk/pub/languages/perl/CPAN/
1516
1517 =item *
1518
1519 Slovenia
1520
1521     ftp://ftp.arnes.si/software/perl/CPAN/
1522
1523 =item *
1524
1525 Spain
1526
1527     ftp://ftp.rediris.es/mirror/CPAN/
1528     ftp://ftp.etse.urv.es/pub/perl/
1529
1530 =item *
1531
1532 Sweden
1533
1534     http://ftp.du.se/CPAN/
1535     ftp://ftp.du.se/pub/CPAN/
1536     ftp://mirror.dataphone.se/pub/CPAN
1537     ftp://ftp.sunet.se/pub/lang/perl/CPAN/
1538
1539 =item *
1540
1541 Switzerland
1542
1543     ftp://ftp.danyk.ch/CPAN/
1544     ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
1545
1546 =item *
1547
1548 Turkey
1549
1550     ftp://sunsite.bilkent.edu.tr/pub/languages/CPAN/
1551
1552 =item *
1553
1554 Ukraine
1555
1556     http://cpan.org.ua/
1557     ftp://cpan.org.ua/
1558     ftp://ftp.perl.org.ua/pub/CPAN/
1559
1560 =back
1561
1562 =head2 North America
1563
1564 =over 4
1565
1566 =item *
1567
1568 Canada
1569
1570 =over 8
1571
1572 =item *
1573
1574 Alberta
1575
1576     http://sunsite.ualberta.ca/pub/Mirror/CPAN/
1577     ftp://sunsite.ualberta.ca/pub/Mirror/CPAN/
1578
1579 =item *
1580
1581 Manitoba
1582
1583     http://theoryx5.uwinnipeg.ca/pub/CPAN/
1584     ftp://theoryx5.uwinnipeg.ca/pub/CPAN/
1585
1586 =item *
1587
1588 Nova Scotia
1589
1590     ftp://cpan.chebucto.ns.ca/pub/CPAN/
1591
1592 =item *
1593
1594 Ontario
1595
1596     ftp://ftp.crc.ca/pub/CPAN/
1597
1598 =item *
1599
1600 Quebec
1601
1602     http://cpan.mirror.smartworker.org/
1603     ftp://cpan.mirror.smartworker.org/pub/CPAN
1604
1605 =back
1606
1607 =item *
1608
1609 Mexico
1610
1611     http://cpan.azc.uam.mx
1612     ftp://cpan.azc.uam.mx/mirrors/CPAN
1613     http://cpan.unam.mx/
1614     ftp://cpan.unam.mx/pub/CPAN
1615     http://www.msg.com.mx/CPAN/
1616     ftp://ftp.msg.com.mx/pub/CPAN/
1617
1618 =item *
1619
1620 United States
1621
1622 =over 8
1623
1624 =item *
1625
1626 Alabama
1627
1628     http://mirror.hiwaay.net/CPAN/
1629     ftp://mirror.hiwaay.net/CPAN/
1630
1631 =item *
1632
1633 California
1634
1635     http://www.cpan.org/
1636     ftp://cpan.valueclick.com/pub/CPAN/
1637     http://mirrors.gossamer-threads.com/CPAN
1638     ftp://cpan.nas.nasa.gov/pub/perl/CPAN/
1639     ftp://ftp.digital.com/pub/plan/perl/CPAN/
1640     http://mirrors.kernel.org/cpan/
1641     ftp://mirrors.kernel.org/pub/CPAN
1642     http://cpan.digisle.net/
1643     ftp://cpan.digisle.net/pub/CPAN
1644     http://www.linuxjar.com/CPAN
1645     ftp://linuxjar.com/pub/CPAN
1646     http://www.perl.com/CPAN/
1647     http://download.sourceforge.net/mirrors/CPAN/
1648
1649 =item *
1650
1651 Colorado
1652
1653     ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
1654
1655 =item *
1656
1657 District of Columbia
1658
1659     ftp://ftp.dc.us.telia.net/pub/cpan/
1660
1661 =item *
1662
1663 Florida
1664
1665     ftp://ftp.cise.ufl.edu/pub/mirrors/CPAN/
1666     http://mirror.csit.fsu.edu/pub/CPAN/
1667     ftp://mirror.csit.fsu.edu/pub/CPAN/
1668
1669 =item *
1670
1671 Illinois
1672
1673     http://uiarchive.uiuc.edu/mirrors/ftp/cpan.cse.msu.edu/
1674     ftp://uiarchive.uiuc.edu/mirrors/ftp/cpan.cse.msu.edu/
1675
1676 =item *
1677
1678 Indiana
1679
1680     ftp://ftp.uwsg.indiana.edu/pub/perl/CPAN/
1681     http://cpan.nitco.com/
1682     ftp://cpan.nitco.com/pub/CPAN/
1683     http://archive.progeny.com/CPAN/
1684     ftp://archive.progeny.com/CPAN/
1685     ftp://cpan.in-span.net/
1686     http://csociety-ftp.ecn.purdue.edu/pub/CPAN
1687     ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN
1688
1689 =item *
1690
1691 Kentucky
1692
1693     http://cpan.uky.edu/
1694     ftp://cpan.uky.edu/pub/CPAN/
1695
1696 =item *
1697
1698 Massachusetts
1699
1700     ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
1701     http://cpan.mirrors.netnumina.com/
1702     ftp://mirrors.netnumina.com/cpan/
1703     ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
1704
1705 =item *
1706
1707 Michigan
1708
1709     ftp://cpan.cse.msu.edu/
1710
1711 =item *
1712
1713 New Jersey
1714
1715     ftp://ftp.cpanel.net/pub/CPAN/
1716
1717 =item *
1718
1719 New York
1720
1721     ftp://ftp.freesoftware.com/pub/perl/CPAN/
1722     ftp://ftp.stealth.net/pub/CPAN/
1723     http://www.rge.com/pub/languages/perl/
1724     ftp://ftp.rge.com/pub/languages/perl/
1725     ftp://mirrors.cloud9.net/pub/mirrors/CPAN/
1726
1727 =item *
1728
1729 North Carolina
1730
1731     ftp://ftp.duke.edu/pub/perl/
1732
1733 =item *
1734
1735 Ohio
1736
1737     ftp://ftp.loaded.net/pub/CPAN/
1738
1739 =item *
1740
1741 Oklahoma
1742
1743     ftp://ftp.ou.edu/mirrors/CPAN/
1744
1745 =item *
1746
1747 Oregon
1748
1749     ftp://ftp.orst.edu/pub/CPAN
1750
1751 =item *
1752
1753 Pennsylvania
1754
1755     http://ftp.epix.net/CPAN/
1756     ftp://ftp.epix.net/pub/languages/perl/
1757     http://mirrors.phenominet.com/pub/CPAN/
1758     ftp://mirrors.phenominet.com/pub/CPAN/
1759     ftp://carroll.cac.psu.edu/pub/CPAN/
1760
1761 =item *
1762
1763 Tennessee
1764
1765     ftp://ftp.sunsite.utk.edu/pub/CPAN/
1766
1767 =item *
1768
1769 Texas
1770
1771     http://ftp.sedl.org/pub/mirrors/CPAN/
1772
1773 =item *
1774
1775 Utah
1776
1777     ftp://mirror.xmission.com/CPAN/
1778
1779 =item *
1780
1781 Virginia
1782
1783     http://mirrors.rcn.net/pub/lang/CPAN/
1784     ftp://mirrors.rcn.net/pub/lang/CPAN/
1785     ftp://ruff.cs.jmu.edu/pub/CPAN/
1786     http://perl.Liquidation.com/CPAN/
1787
1788 =item *
1789
1790 Washington
1791
1792     http://cpan.llarian.net/
1793     ftp://cpan.llarian.net/pub/CPAN/
1794     http://cpan.mirrorcentral.com/
1795     ftp://ftp.mirrorcentral.com/pub/CPAN/
1796     ftp://ftp-mirror.internap.com/pub/CPAN/
1797
1798 =back
1799
1800 =back
1801
1802 =head2 Oceania
1803
1804 =over 4
1805
1806 =item *
1807
1808 Australia
1809
1810     http://ftp.planetmirror.com/pub/CPAN/
1811     ftp://ftp.planetmirror.com/pub/CPAN/
1812     ftp://mirror.aarnet.edu.au/pub/perl/CPAN/
1813     ftp://cpan.topend.com.au/pub/CPAN/
1814
1815 =item *
1816
1817 New Zealand
1818     ftp://ftp.auckland.ac.nz/pub/perl/CPAN/
1819
1820 =back
1821
1822 =head2 South America
1823
1824 =over 4
1825
1826 =item *
1827
1828 Argentina
1829
1830     ftp://mirrors.bannerlandia.com.ar/mirrors/CPAN/
1831
1832 =item *
1833
1834 Brazil
1835
1836     ftp://cpan.pop-mg.com.br/pub/CPAN/
1837     ftp://ftp.matrix.com.br/pub/perl/CPAN/
1838
1839 =item *
1840
1841 Chile
1842
1843     ftp://ftp.psinet.cl/pub/programming/perl/CPAN/
1844     ftp://sunsite.dcc.uchile.cl/pub/lang/perl/
1845
1846 =back
1847
1848
1849 For an up-to-date listing of CPAN sites,
1850 see http://www.cpan.org/SITES or ftp://www.cpan.org/SITES .
1851
1852 =head1 Modules: Creation, Use, and Abuse
1853
1854 (The following section is borrowed directly from Tim Bunce's modules
1855 file, available at your nearest CPAN site.)
1856
1857 Perl implements a class using a package, but the presence of a
1858 package doesn't imply the presence of a class.  A package is just a
1859 namespace.  A class is a package that provides subroutines that can be
1860 used as methods.  A method is just a subroutine that expects, as its
1861 first argument, either the name of a package (for "static" methods),
1862 or a reference to something (for "virtual" methods).
1863
1864 A module is a file that (by convention) provides a class of the same
1865 name (sans the .pm), plus an import method in that class that can be
1866 called to fetch exported symbols.  This module may implement some of
1867 its methods by loading dynamic C or C++ objects, but that should be
1868 totally transparent to the user of the module.  Likewise, the module
1869 might set up an AUTOLOAD function to slurp in subroutine definitions on
1870 demand, but this is also transparent.  Only the F<.pm> file is required to
1871 exist.  See L<perlsub>, L<perltoot>, and L<AutoLoader> for details about
1872 the AUTOLOAD mechanism.
1873
1874 =head2 Guidelines for Module Creation
1875
1876 =over 4
1877
1878 =item  *
1879
1880 Do similar modules already exist in some form?
1881
1882 If so, please try to reuse the existing modules either in whole or
1883 by inheriting useful features into a new class.  If this is not
1884 practical try to get together with the module authors to work on
1885 extending or enhancing the functionality of the existing modules.
1886 A perfect example is the plethora of packages in perl4 for dealing
1887 with command line options.
1888
1889 If you are writing a module to expand an already existing set of
1890 modules, please coordinate with the author of the package.  It
1891 helps if you follow the same naming scheme and module interaction
1892 scheme as the original author.
1893
1894 =item  *
1895
1896 Try to design the new module to be easy to extend and reuse.
1897
1898 Try to C<use warnings;> (or C<use warnings qw(...);>).
1899 Remember that you can add C<no warnings qw(...);> to individual blocks
1900 of code that need less warnings.
1901
1902 Use blessed references.  Use the two argument form of bless to bless
1903 into the class name given as the first parameter of the constructor,
1904 e.g.,:
1905
1906  sub new {
1907      my $class = shift;
1908      return bless {}, $class;
1909  }
1910
1911 or even this if you'd like it to be used as either a static
1912 or a virtual method.
1913
1914  sub new {
1915      my $self  = shift;
1916      my $class = ref($self) || $self;
1917      return bless {}, $class;
1918  }
1919
1920 Pass arrays as references so more parameters can be added later
1921 (it's also faster).  Convert functions into methods where
1922 appropriate.  Split large methods into smaller more flexible ones.
1923 Inherit methods from other modules if appropriate.
1924
1925 Avoid class name tests like: C<die "Invalid" unless ref $ref eq 'FOO'>.
1926 Generally you can delete the C<eq 'FOO'> part with no harm at all.
1927 Let the objects look after themselves! Generally, avoid hard-wired
1928 class names as far as possible.
1929
1930 Avoid C<< $r->Class::func() >> where using C<@ISA=qw(... Class ...)> and
1931 C<< $r->func() >> would work (see L<perlbot> for more details).
1932
1933 Use autosplit so little used or newly added functions won't be a
1934 burden to programs that don't use them. Add test functions to
1935 the module after __END__ either using AutoSplit or by saying:
1936
1937  eval join('',<main::DATA>) || die $@ unless caller();
1938
1939 Does your module pass the 'empty subclass' test? If you say
1940 C<@SUBCLASS::ISA = qw(YOURCLASS);> your applications should be able
1941 to use SUBCLASS in exactly the same way as YOURCLASS.  For example,
1942 does your application still work if you change:  C<$obj = new YOURCLASS;>
1943 into: C<$obj = new SUBCLASS;> ?
1944
1945 Avoid keeping any state information in your packages. It makes it
1946 difficult for multiple other packages to use yours. Keep state
1947 information in objects.
1948
1949 Always use B<-w>.
1950
1951 Try to C<use strict;> (or C<use strict qw(...);>).
1952 Remember that you can add C<no strict qw(...);> to individual blocks
1953 of code that need less strictness.
1954
1955 Always use B<-w>.
1956
1957 Follow the guidelines in the perlstyle(1) manual.
1958
1959 Always use B<-w>.
1960
1961 =item  *
1962
1963 Some simple style guidelines
1964
1965 The perlstyle manual supplied with Perl has many helpful points.
1966
1967 Coding style is a matter of personal taste. Many people evolve their
1968 style over several years as they learn what helps them write and
1969 maintain good code.  Here's one set of assorted suggestions that
1970 seem to be widely used by experienced developers:
1971
1972 Use underscores to separate words.  It is generally easier to read
1973 $var_names_like_this than $VarNamesLikeThis, especially for
1974 non-native speakers of English. It's also a simple rule that works
1975 consistently with VAR_NAMES_LIKE_THIS.
1976
1977 Package/Module names are an exception to this rule. Perl informally
1978 reserves lowercase module names for 'pragma' modules like integer
1979 and strict. Other modules normally begin with a capital letter and
1980 use mixed case with no underscores (need to be short and portable).
1981
1982 You may find it helpful to use letter case to indicate the scope
1983 or nature of a variable. For example:
1984
1985  $ALL_CAPS_HERE   constants only (beware clashes with Perl vars)
1986  $Some_Caps_Here  package-wide global/static
1987  $no_caps_here    function scope my() or local() variables
1988
1989 Function and method names seem to work best as all lowercase.
1990 e.g., C<< $obj->as_string() >>.
1991
1992 You can use a leading underscore to indicate that a variable or
1993 function should not be used outside the package that defined it.
1994
1995 =item  *
1996
1997 Select what to export.
1998
1999 Do NOT export method names!
2000
2001 Do NOT export anything else by default without a good reason!
2002
2003 Exports pollute the namespace of the module user.  If you must
2004 export try to use @EXPORT_OK in preference to @EXPORT and avoid
2005 short or common names to reduce the risk of name clashes.
2006
2007 Generally anything not exported is still accessible from outside the
2008 module using the ModuleName::item_name (or C<< $blessed_ref->method >>)
2009 syntax.  By convention you can use a leading underscore on names to
2010 indicate informally that they are 'internal' and not for public use.
2011
2012 (It is actually possible to get private functions by saying:
2013 C<my $subref = sub { ... };  &$subref;>.  But there's no way to call that
2014 directly as a method, because a method must have a name in the symbol
2015 table.)
2016
2017 As a general rule, if the module is trying to be object oriented
2018 then export nothing. If it's just a collection of functions then
2019 @EXPORT_OK anything but use @EXPORT with caution.
2020
2021 =item  *
2022
2023 Select a name for the module.
2024
2025 This name should be as descriptive, accurate, and complete as
2026 possible.  Avoid any risk of ambiguity. Always try to use two or
2027 more whole words.  Generally the name should reflect what is special
2028 about what the module does rather than how it does it.  Please use
2029 nested module names to group informally or categorize a module.
2030 There should be a very good reason for a module not to have a nested name.
2031 Module names should begin with a capital letter.
2032
2033 Having 57 modules all called Sort will not make life easy for anyone
2034 (though having 23 called Sort::Quick is only marginally better :-).
2035 Imagine someone trying to install your module alongside many others.
2036 If in any doubt ask for suggestions in comp.lang.perl.misc.
2037
2038 If you are developing a suite of related modules/classes it's good
2039 practice to use nested classes with a common prefix as this will
2040 avoid namespace clashes. For example: Xyz::Control, Xyz::View,
2041 Xyz::Model etc. Use the modules in this list as a naming guide.
2042
2043 If adding a new module to a set, follow the original author's
2044 standards for naming modules and the interface to methods in
2045 those modules.
2046
2047 If developing modules for private internal or project specific use,
2048 that will never be released to the public, then you should ensure
2049 that their names will not clash with any future public module. You
2050 can do this either by using the reserved Local::* category or by
2051 using a category name that includes an underscore like Foo_Corp::*.
2052
2053 To be portable each component of a module name should be limited to
2054 11 characters. If it might be used on MS-DOS then try to ensure each is
2055 unique in the first 8 characters. Nested modules make this easier.
2056
2057 =item  *
2058
2059 Have you got it right?
2060
2061 How do you know that you've made the right decisions? Have you
2062 picked an interface design that will cause problems later? Have
2063 you picked the most appropriate name? Do you have any questions?
2064
2065 The best way to know for sure, and pick up many helpful suggestions,
2066 is to ask someone who knows. Comp.lang.perl.misc is read by just about
2067 all the people who develop modules and it's the best place to ask.
2068
2069 All you need to do is post a short summary of the module, its
2070 purpose and interfaces. A few lines on each of the main methods is
2071 probably enough. (If you post the whole module it might be ignored
2072 by busy people - generally the very people you want to read it!)
2073
2074 Don't worry about posting if you can't say when the module will be
2075 ready - just say so in the message. It might be worth inviting
2076 others to help you, they may be able to complete it for you!
2077
2078 =item  *
2079
2080 README and other Additional Files.
2081
2082 It's well known that software developers usually fully document the
2083 software they write. If, however, the world is in urgent need of
2084 your software and there is not enough time to write the full
2085 documentation please at least provide a README file containing:
2086
2087 =over 10
2088
2089 =item *
2090
2091 A description of the module/package/extension etc.
2092
2093 =item *
2094
2095 A copyright notice - see below.
2096
2097 =item *
2098
2099 Prerequisites - what else you may need to have.
2100
2101 =item *
2102
2103 How to build it - possible changes to Makefile.PL etc.
2104
2105 =item *
2106
2107 How to install it.
2108
2109 =item *
2110
2111 Recent changes in this release, especially incompatibilities
2112
2113 =item *
2114
2115 Changes / enhancements you plan to make in the future.
2116
2117 =back
2118
2119 If the README file seems to be getting too large you may wish to
2120 split out some of the sections into separate files: INSTALL,
2121 Copying, ToDo etc.
2122
2123 =over 4
2124
2125 =item *
2126
2127 Adding a Copyright Notice.
2128
2129 How you choose to license your work is a personal decision.
2130 The general mechanism is to assert your Copyright and then make
2131 a declaration of how others may copy/use/modify your work.
2132
2133 Perl, for example, is supplied with two types of licence: The GNU
2134 GPL and The Artistic Licence (see the files README, Copying, and
2135 Artistic).  Larry has good reasons for NOT just using the GNU GPL.
2136
2137 My personal recommendation, out of respect for Larry, Perl, and the
2138 Perl community at large is to state something simply like:
2139
2140  Copyright (c) 1995 Your Name. All rights reserved.
2141  This program is free software; you can redistribute it and/or
2142  modify it under the same terms as Perl itself.
2143
2144 This statement should at least appear in the README file. You may
2145 also wish to include it in a Copying file and your source files.
2146 Remember to include the other words in addition to the Copyright.
2147
2148 =item  *
2149
2150 Give the module a version/issue/release number.
2151
2152 To be fully compatible with the Exporter and MakeMaker modules you
2153 should store your module's version number in a non-my package
2154 variable called $VERSION.  This should be a floating point
2155 number with at least two digits after the decimal (i.e., hundredths,
2156 e.g, C<$VERSION = "0.01">).  Don't use a "1.3.2" style version.
2157 See L<Exporter> for details.
2158
2159 It may be handy to add a function or method to retrieve the number.
2160 Use the number in announcements and archive file names when
2161 releasing the module (ModuleName-1.02.tar.Z).
2162 See perldoc ExtUtils::MakeMaker.pm for details.
2163
2164 =item  *
2165
2166 How to release and distribute a module.
2167
2168 It's good idea to post an announcement of the availability of your
2169 module (or the module itself if small) to the comp.lang.perl.announce
2170 Usenet newsgroup.  This will at least ensure very wide once-off
2171 distribution.
2172
2173 If possible, register the module with CPAN.  You should
2174 include details of its location in your announcement.
2175
2176 Some notes about ftp archives: Please use a long descriptive file
2177 name that includes the version number. Most incoming directories
2178 will not be readable/listable, i.e., you won't be able to see your
2179 file after uploading it. Remember to send your email notification
2180 message as soon as possible after uploading else your file may get
2181 deleted automatically. Allow time for the file to be processed
2182 and/or check the file has been processed before announcing its
2183 location.
2184
2185 FTP Archives for Perl Modules:
2186
2187 Follow the instructions and links on:
2188
2189    http://www.cpan.org/modules/00modlist.long.html
2190    http://www.cpan.org/modules/04pause.html
2191
2192 or upload to one of these sites:
2193
2194    https://pause.kbx.de/pause/
2195    http://pause.perl.org/pause/
2196
2197 and notify <modules@perl.org>.
2198
2199 By using the WWW interface you can ask the Upload Server to mirror
2200 your modules from your ftp or WWW site into your own directory on
2201 CPAN!
2202
2203 Please remember to send me an updated entry for the Module list!
2204
2205 =item  *
2206
2207 Take care when changing a released module.
2208
2209 Always strive to remain compatible with previous released versions.
2210 Otherwise try to add a mechanism to revert to the
2211 old behavior if people rely on it.  Document incompatible changes.
2212
2213 =back
2214
2215 =back
2216
2217 =head2 Guidelines for Converting Perl 4 Library Scripts into Modules
2218
2219 =over 4
2220
2221 =item  *
2222
2223 There is no requirement to convert anything.
2224
2225 If it ain't broke, don't fix it! Perl 4 library scripts should
2226 continue to work with no problems. You may need to make some minor
2227 changes (like escaping non-array @'s in double quoted strings) but
2228 there is no need to convert a .pl file into a Module for just that.
2229
2230 =item  *
2231
2232 Consider the implications.
2233
2234 All Perl applications that make use of the script will need to
2235 be changed (slightly) if the script is converted into a module.  Is
2236 it worth it unless you plan to make other changes at the same time?
2237
2238 =item  *
2239
2240 Make the most of the opportunity.
2241
2242 If you are going to convert the script to a module you can use the
2243 opportunity to redesign the interface.  The guidelines for module
2244 creation above include many of the issues you should consider.
2245
2246 =item  *
2247
2248 The pl2pm utility will get you started.
2249
2250 This utility will read *.pl files (given as parameters) and write
2251 corresponding *.pm files. The pl2pm utilities does the following:
2252
2253 =over 10
2254
2255 =item *
2256
2257 Adds the standard Module prologue lines
2258
2259 =item *
2260
2261 Converts package specifiers from ' to ::
2262
2263 =item *
2264
2265 Converts die(...) to croak(...)
2266
2267 =item *
2268
2269 Several other minor changes
2270
2271 =back
2272
2273 Being a mechanical process pl2pm is not bullet proof. The converted
2274 code will need careful checking, especially any package statements.
2275 Don't delete the original .pl file till the new .pm one works!
2276
2277 =back
2278
2279 =head2 Guidelines for Reusing Application Code
2280
2281 =over 4
2282
2283 =item  *
2284
2285 Complete applications rarely belong in the Perl Module Library.
2286
2287 =item  *
2288
2289 Many applications contain some Perl code that could be reused.
2290
2291 Help save the world! Share your code in a form that makes it easy
2292 to reuse.
2293
2294 =item  *
2295
2296 Break-out the reusable code into one or more separate module files.
2297
2298 =item  *
2299
2300 Take the opportunity to reconsider and redesign the interfaces.
2301
2302 =item  *
2303
2304 In some cases the 'application' can then be reduced to a small
2305
2306 fragment of code built on top of the reusable modules. In these cases
2307 the application could invoked as:
2308
2309      % perl -e 'use Module::Name; method(@ARGV)' ...
2310 or
2311      % perl -mModule::Name ...    (in perl5.002 or higher)
2312
2313 =back
2314
2315 =head1 NOTE
2316
2317 Perl does not enforce private and public parts of its modules as you may
2318 have been used to in other languages like C++, Ada, or Modula-17.  Perl
2319 doesn't have an infatuation with enforced privacy.  It would prefer
2320 that you stayed out of its living room because you weren't invited, not
2321 because it has a shotgun.
2322
2323 The module and its user have a contract, part of which is common law,
2324 and part of which is "written".  Part of the common law contract is
2325 that a module doesn't pollute any namespace it wasn't asked to.  The
2326 written contract for the module (A.K.A. documentation) may make other
2327 provisions.  But then you know when you C<use RedefineTheWorld> that
2328 you're redefining the world and willing to take the consequences.