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