home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / perlmodlib.z / perlmodlib
Encoding:
Text File  |  2002-10-03  |  41.5 KB  |  1,189 lines

  1.  
  2.  
  3.  
  4. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      perlmodlib - constructing new Perl modules and finding existing ones
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12. TTTTHHHHEEEE PPPPEEEERRRRLLLL MMMMOOOODDDDUUUULLLLEEEE LLLLIIIIBBBBRRRRAAAARRRRYYYY
  13.      A number of modules are included the Perl distribution.  These are
  14.      described below, and all end in ._p_m.  You may also discover files in the
  15.      library directory that end in either ._p_l or ._p_h.  These are old libraries
  16.      supplied so that old programs that use them still run.  The ._p_l files
  17.      will all eventually be converted into standard modules, and the ._p_h files
  18.      made by hhhh2222pppphhhh will probably end up as extension modules made by hhhh2222xxxxssss.
  19.      (Some ._p_h values may already be available through the POSIX module.)  The
  20.      ppppllll2222ppppmmmm file in the distribution may help in your conversion, but it's just
  21.      a mechanical process and therefore far from bulletproof.
  22.  
  23.      PPPPrrrraaaaggggmmmmaaaattttiiiicccc MMMMoooodddduuuulllleeeessss
  24.  
  25.      They work somewhat like pragmas in that they tend to affect the
  26.      compilation of your program, and thus will usually work well only when
  27.      used within a use, or no.  Most of these are locally scoped, so an inner
  28.      BLOCK may countermand any of these by saying:
  29.  
  30.          no integer;
  31.          no strict 'refs';
  32.  
  33.      which lasts until the end of that BLOCK.
  34.  
  35.      Unlike the pragmas that effect the $^H hints variable, the use vars and
  36.      use subs declarations are not BLOCK-scoped.  They allow you to predeclare
  37.      a variables or subroutines within a particular _f_i_l_e rather than just a
  38.      block.  Such declarations are effective for the entire file for which
  39.      they were declared.  You cannot rescind them with no vars or no subs.
  40.  
  41.      The following pragmas are defined (and have their own documentation).
  42.  
  43.      use autouse MODULE => qw(sub1 sub2 sub3)
  44.                  Defers require MODULE until someone calls one of the
  45.                  specified subroutines (which must be exported by MODULE).
  46.                  This pragma should be used with caution, and only when
  47.                  necessary.
  48.  
  49.      blib        manipulate @INC at compile time to use MakeMaker's
  50.                  uninstalled version of a package
  51.  
  52.      diagnostics force verbose warning diagnostics
  53.  
  54.      integer     compute arithmetic in integer instead of double
  55.  
  56.      less        request less of something from the compiler
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  71.  
  72.  
  73.  
  74.      lib         manipulate @INC at compile time
  75.  
  76.      locale      use or ignore current locale for builtin operations (see the
  77.                  _p_e_r_l_l_o_c_a_l_e manpage)
  78.  
  79.      ops         restrict named opcodes when compiling or running Perl code
  80.  
  81.      overload    overload basic Perl operations
  82.  
  83.      re          alter behaviour of regular expressions
  84.  
  85.      sigtrap     enable simple signal handling
  86.  
  87.      strict      restrict unsafe constructs
  88.  
  89.      subs        predeclare sub names
  90.  
  91.      vmsish      adopt certain VMS-specific behaviors
  92.  
  93.      vars        predeclare global variable names
  94.  
  95.      SSSSttttaaaannnnddddaaaarrrrdddd MMMMoooodddduuuulllleeeessss
  96.  
  97.      Standard, bundled modules are all expected to behave in a well-defined
  98.      manner with respect to namespace pollution because they use the Exporter
  99.      module.  See their own documentation for details.
  100.  
  101.      AnyDBM_File provide framework for multiple DBMs
  102.  
  103.      AutoLoader  load functions only on demand
  104.  
  105.      AutoSplit   split a package for autoloading
  106.  
  107.      Benchmark   benchmark running times of code
  108.  
  109.      CPAN        interface to Comprehensive Perl Archive Network
  110.  
  111.      CPAN::FirstTime
  112.                  create a CPAN configuration file
  113.  
  114.      CPAN::Nox   run CPAN while avoiding compiled extensions
  115.  
  116.      Carp        warn of errors (from perspective of caller)
  117.  
  118.      Class::Struct
  119.                  declare struct-like datatypes
  120.  
  121.      Config      access Perl configuration information
  122.  
  123.      Cwd         get pathname of current working directory
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  137.  
  138.  
  139.  
  140.      DB_File     access to Berkeley DB
  141.  
  142.      Devel::SelfStubber
  143.                  generate stubs for a SelfLoading module
  144.  
  145.      DirHandle   supply object methods for directory handles
  146.  
  147.      DynaLoader  dynamically load C libraries into Perl code
  148.  
  149.      English     use nice English (or awk) names for ugly punctuation
  150.                  variables
  151.  
  152.      Env         import environment variables
  153.  
  154.      Exporter    implements default import method for modules
  155.  
  156.      ExtUtils::Embed
  157.                  utilities for embedding Perl in C/C++ applications
  158.  
  159.      ExtUtils::Install
  160.                  install files from here to there
  161.  
  162.      ExtUtils::Liblist
  163.                  determine libraries to use and how to use them
  164.  
  165.      ExtUtils::MM_OS2
  166.                  methods to override Unix behaviour in ExtUtils::MakeMaker
  167.  
  168.      ExtUtils::MM_Unix
  169.                  methods used by ExtUtils::MakeMaker
  170.  
  171.      ExtUtils::MM_VMS
  172.                  methods to override Unix behaviour in ExtUtils::MakeMaker
  173.  
  174.      ExtUtils::MakeMaker
  175.                  create an extension Makefile
  176.  
  177.      ExtUtils::Manifest
  178.                  utilities to write and check a MANIFEST file
  179.  
  180.      ExtUtils::Mkbootstrap
  181.                  make a bootstrap file for use by DynaLoader
  182.  
  183.      ExtUtils::Mksymlists
  184.                  write linker options files for dynamic extension
  185.  
  186.      ExtUtils::testlib
  187.                  add blib/* directories to @INC
  188.  
  189.      Fcntl       load the C Fcntl.h defines
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  203.  
  204.  
  205.  
  206.      File::Basename
  207.                  split a pathname into pieces
  208.  
  209.      File::CheckTree
  210.                  run many filetest checks on a tree
  211.  
  212.      File::Compare
  213.                  compare files or filehandles
  214.  
  215.      File::Copy  copy files or filehandles
  216.  
  217.      File::Find  traverse a file tree
  218.  
  219.      File::Path  create or remove a series of directories
  220.  
  221.      File::stat  by-name interface to Perl's builtin _s_t_a_t() functions
  222.  
  223.      FileCache   keep more files open than the system permits
  224.  
  225.      FileHandle  supply object methods for filehandles
  226.  
  227.      FindBin     locate directory of original Perl script
  228.  
  229.      GDBM_File   access to the gdbm library
  230.  
  231.      Getopt::Long
  232.                  extended processing of command line options
  233.  
  234.      Getopt::Std process single-character switches with switch clustering
  235.  
  236.      I18N::Collate
  237.                  compare 8-bit scalar data according to the current locale
  238.  
  239.      IO          load various IO modules
  240.  
  241.      IO::File    supply object methods for filehandles
  242.  
  243.      IO::Handle  supply object methods for I/O handles
  244.  
  245.      IO::Pipe    supply object methods for pipes
  246.  
  247.      IO::Seekable
  248.                  supply seek based methods for I/O objects
  249.  
  250.      IO::Select  OO interface to the select system call
  251.  
  252.      IO::Socket  object interface to socket communications
  253.  
  254.      IPC::Open2  open a process for both reading and writing
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  269.  
  270.  
  271.  
  272.      IPC::Open3  open a process for reading, writing, and error handling
  273.  
  274.      Math::BigFloat
  275.                  arbitrary length float math package
  276.  
  277.      Math::BigInt
  278.                  arbitrary size integer math package
  279.  
  280.      Math::Complex
  281.                  complex numbers and associated mathematical functions
  282.  
  283.      Math::Trig  simple interface to parts of Math::Complex for those who need
  284.                  trigonometric functions only for real numbers
  285.  
  286.      NDBM_File   tied access to ndbm files
  287.  
  288.      Net::Ping   Hello, anybody home?
  289.  
  290.      Net::hostent
  291.                  by-name interface to Perl's builtin gethost*() functions
  292.  
  293.      Net::netent by-name interface to Perl's builtin getnet*() functions
  294.  
  295.      Net::protoent
  296.                  by-name interface to Perl's builtin getproto*() functions
  297.  
  298.      Net::servent
  299.                  by-name interface to Perl's builtin getserv*() functions
  300.  
  301.      Opcode      disable named opcodes when compiling or running Perl code
  302.  
  303.      Pod::Text   convert POD data to formatted ASCII text
  304.  
  305.      POSIX       interface to IEEE Standard 1003.1
  306.  
  307.      SDBM_File   tied access to sdbm files
  308.  
  309.      Safe        compile and execute code in restricted compartments
  310.  
  311.      Search::Dict
  312.                  search for key in dictionary file
  313.  
  314.      SelectSaver save and restore selected file handle
  315.  
  316.      SelfLoader  load functions only on demand
  317.  
  318.      Shell       run shell commands transparently within Perl
  319.  
  320.      Socket      load the C socket.h defines and structure manipulators
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  335.  
  336.  
  337.  
  338.      Symbol      manipulate Perl symbols and their names
  339.  
  340.      Sys::Hostname
  341.                  try every conceivable way to get hostname
  342.  
  343.      Sys::Syslog interface to the Unix _s_y_s_l_o_g(3) calls
  344.  
  345.      Term::Cap   termcap interface
  346.  
  347.      Term::Complete
  348.                  word completion module
  349.  
  350.      Term::ReadLine
  351.                  interface to various readline packages
  352.  
  353.      Test::Harness
  354.                  run Perl standard test scripts with statistics
  355.  
  356.      Text::Abbrev
  357.                  create an abbreviation table from a list
  358.  
  359.      Text::ParseWords
  360.                  parse text into an array of tokens
  361.  
  362.      Text::Soundex
  363.                  implementation of the Soundex Algorithm as described by Knuth
  364.  
  365.      Text::Tabs  expand and unexpand tabs per the Unix _e_x_p_a_n_d(1) and
  366.                  _u_n_e_x_p_a_n_d(1)
  367.  
  368.      Text::Wrap  line wrapping to form simple paragraphs
  369.  
  370.      Tie::Hash   base class definitions for tied hashes
  371.  
  372.      Tie::RefHash
  373.                  base class definitions for tied hashes with references as
  374.                  keys
  375.  
  376.      Tie::Scalar base class definitions for tied scalars
  377.  
  378.      Tie::SubstrHash
  379.                  fixed-table-size, fixed-key-length hashing
  380.  
  381.      Time::Local efficiently compute time from local and GMT time
  382.  
  383.      Time::gmtime
  384.                  by-name interface to Perl's builtin _g_m_t_i_m_e() function
  385.  
  386.      Time::localtime
  387.                  by-name interface to Perl's builtin _l_o_c_a_l_t_i_m_e() function
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  401.  
  402.  
  403.  
  404.      Time::tm    internal object used by Time::gmtime and Time::localtime
  405.  
  406.      UNIVERSAL   base class for ALL classes (blessed references)
  407.  
  408.      User::grent by-name interface to Perl's builtin getgr*() functions
  409.  
  410.      User::pwent by-name interface to Perl's builtin getpw*() functions
  411.  
  412.      To find out _a_l_l the modules installed on your system, including those
  413.      without documentation or outside the standard release, do this:
  414.  
  415.          % find `perl -e 'print "@INC"'` -name '*.pm' -print
  416.  
  417.      They should all have their own documentation installed and accessible via
  418.      your system _m_a_n(1) command.  If that fails, try the _p_e_r_l_d_o_c program.
  419.  
  420.      EEEExxxxtttteeeennnnssssiiiioooonnnn MMMMoooodddduuuulllleeeessss
  421.  
  422.      Extension modules are written in C (or a mix of Perl and C) and may be
  423.      statically linked or in general are dynamically loaded into Perl if and
  424.      when you need them.  Supported extension modules include the Socket,
  425.      Fcntl, and POSIX modules.
  426.  
  427.      Many popular C extension modules do not come bundled (at least, not
  428.      completely) due to their sizes, volatility, or simply lack of time for
  429.      adequate testing and configuration across the multitude of platforms on
  430.      which Perl was beta-tested.  You are encouraged to look for them in
  431.      _a_r_c_h_i_e(1L), the Perl FAQ or Meta-FAQ, the WWW page, and even with their
  432.      authors before randomly posting asking for their present condition and
  433.      disposition.
  434.  
  435. CCCCPPPPAAAANNNN
  436.      CPAN stands for the Comprehensive Perl Archive Network.  This is a
  437.      globally replicated collection of all known Perl materials, including
  438.      hundreds of unbundled modules.  Here are the major categories of modules:
  439.  
  440.      +o Language Extensions and Documentation Tools
  441.  
  442.      +o Development Support
  443.  
  444.      +o Operating System Interfaces
  445.  
  446.      +o Networking, Device Control (modems) and InterProcess Communication
  447.  
  448.      +o Data Types and Data Type Utilities
  449.  
  450.      +o Database Interfaces
  451.  
  452.      +o User Interfaces
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  467.  
  468.  
  469.  
  470.      +o Interfaces to / Emulations of Other Programming Languages
  471.  
  472.      +o File Names, File Systems and File Locking (see also File Handles)
  473.  
  474.      +o String Processing, Language Text Processing, Parsing, and Searching
  475.  
  476.      +o Option, Argument, Parameter, and Configuration File Processing
  477.  
  478.      +o Internationalization and Locale
  479.  
  480.      +o Authentication, Security, and Encryption
  481.  
  482.      +o World Wide Web, HTML, HTTP, CGI, MIME
  483.  
  484.      +o Server and Daemon Utilities
  485.  
  486.      +o Archiving and Compression
  487.  
  488.      +o Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing
  489.  
  490.      +o Mail and Usenet News
  491.  
  492.      +o Control Flow Utilities (callbacks and exceptions etc)
  493.  
  494.      +o File Handle and Input/Output Stream Utilities
  495.  
  496.      +o Miscellaneous Modules
  497.  
  498.      The registered CPAN sites as of this writing include the following.  You
  499.      should try to choose one close to you:
  500.  
  501.      +o Africa
  502.  
  503.               South Africa    ftp://ftp.is.co.za/programming/perl/CPAN/
  504.  
  505.  
  506.      +o Asia
  507.  
  508.               Hong Kong       ftp://ftp.hkstar.com/pub/CPAN/
  509.               Japan           ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
  510.                               ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
  511.               South Korea     ftp://ftp.nuri.net/pub/CPAN/
  512.               Taiwan          ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
  513.                               ftp://ftp.wownet.net/pub2/PERL/
  514.  
  515.  
  516.      +o Australasia
  517.  
  518.               Australia       ftp://ftp.netinfo.com.au/pub/perl/CPAN/
  519.               New Zealand     ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  533.  
  534.  
  535.  
  536.      +o Europe
  537.  
  538.               Austria         ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
  539.               Belgium         ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
  540.               Czech Republic  ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
  541.               Denmark         ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
  542.               Finland         ftp://ftp.funet.fi/pub/languages/perl/CPAN/
  543.               France          ftp://ftp.ibp.fr/pub/perl/CPAN/
  544.                               ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
  545.               Germany         ftp://ftp.gmd.de/packages/CPAN/
  546.                               ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/
  547.                               ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
  548.                               ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/
  549.                               ftp://ftp.uni-erlangen.de/pub/source/Perl/CPAN/
  550.                               ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
  551.               Greece          ftp://ftp.ntua.gr/pub/lang/perl/
  552.               Hungary         ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
  553.               Italy           ftp://cis.utovrm.it/CPAN/
  554.               the Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
  555.                               ftp://ftp.EU.net/packages/cpan/
  556.               Norway          ftp://ftp.uit.no/pub/languages/perl/cpan/
  557.               Poland          ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
  558.                               ftp://sunsite.icm.edu.pl/pub/CPAN/
  559.               Portugal        ftp://ftp.ci.uminho.pt/pub/lang/perl/
  560.                               ftp://ftp.telepac.pt/pub/CPAN/
  561.               Russia          ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
  562.               Slovenia        ftp://ftp.arnes.si/software/perl/CPAN/
  563.               Spain           ftp://ftp.etse.urv.es/pub/mirror/perl/
  564.                               ftp://ftp.rediris.es/mirror/CPAN/
  565.               Sweden          ftp://ftp.sunet.se/pub/lang/perl/CPAN/
  566.               UK              ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
  567.                               ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
  568.                               ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/
  569.  
  570.  
  571.      +o North America
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  599.  
  600.  
  601.  
  602.               Ontario         ftp://ftp.utilis.com/public/CPAN/
  603.                               ftp://enterprise.ic.gc.ca/pub/perl/CPAN/
  604.               Manitoba        ftp://theory.uwinnipeg.ca/pub/CPAN/
  605.               California      ftp://ftp.digital.com/pub/plan/perl/CPAN/
  606.                               ftp://ftp.cdrom.com/pub/perl/CPAN/
  607.               Colorado        ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
  608.               Florida         ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
  609.               Illinois        ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
  610.               Massachusetts   ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
  611.               New York        ftp://ftp.rge.com/pub/languages/perl/
  612.               North Carolina  ftp://ftp.duke.edu/pub/perl/
  613.               Oklahoma        ftp://ftp.ou.edu/mirrors/CPAN/
  614.               Oregon          http://www.perl.org/CPAN/
  615.                               ftp://ftp.orst.edu/pub/packages/CPAN/
  616.               Pennsylvania    ftp://ftp.epix.net/pub/languages/perl/
  617.               Texas           ftp://ftp.sedl.org/pub/mirrors/CPAN/
  618.                               ftp://ftp.metronet.com/pub/perl/
  619.  
  620.  
  621.      +o South America
  622.  
  623.               Chile           ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/
  624.  
  625.  
  626.      For an up-to-date listing of CPAN sites, see
  627.      _h_t_t_p://_w_w_w._p_e_r_l._c_o_m/_p_e_r_l/_C_P_A_N or _f_t_p://_f_t_p._p_e_r_l._c_o_m/_p_e_r_l/.
  628.  
  629. MMMMoooodddduuuulllleeeessss:::: CCCCrrrreeeeaaaattttiiiioooonnnn,,,, UUUUsssseeee,,,, aaaannnndddd AAAAbbbbuuuusssseeee
  630.      (The following section is borrowed directly from Tim Bunce's modules
  631.      file, available at your nearest CPAN site.)
  632.  
  633.      Perl implements a class using a package, but the presence of a package
  634.      doesn't imply the presence of a class.  A package is just a namespace.  A
  635.      class is a package that provides subroutines that can be used as methods.
  636.      A method is just a subroutine that expects, as its first argument, either
  637.      the name of a package (for "static" methods), or a reference to something
  638.      (for "virtual" methods).
  639.  
  640.      A module is a file that (by convention) provides a class of the same name
  641.      (sans the .pm), plus an import method in that class that can be called to
  642.      fetch exported symbols.  This module may implement some of its methods by
  643.      loading dynamic C or C++ objects, but that should be totally transparent
  644.      to the user of the module.  Likewise, the module might set up an AUTOLOAD
  645.      function to slurp in subroutine definitions on demand, but this is also
  646.      transparent.  Only the ._p_m file is required to exist.  See the _p_e_r_l_s_u_b
  647.      manpage, the _p_e_r_l_t_o_o_t manpage, and the _A_u_t_o_L_o_a_d_e_r manpage for details
  648.      about the AUTOLOAD mechanism.
  649.  
  650.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr MMMMoooodddduuuulllleeee CCCCrrrreeeeaaaattttiiiioooonnnn
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  665.  
  666.  
  667.  
  668.      Do similar modules already exist in some form?
  669.          If so, please try to reuse the existing modules either in whole or by
  670.          inheriting useful features into a new class.  If this is not
  671.          practical try to get together with the module authors to work on
  672.          extending or enhancing the functionality of the existing modules.  A
  673.          perfect example is the plethora of packages in perl4 for dealing with
  674.          command line options.
  675.  
  676.          If you are writing a module to expand an already existing set of
  677.          modules, please coordinate with the author of the package.  It helps
  678.          if you follow the same naming scheme and module interaction scheme as
  679.          the original author.
  680.  
  681.      Try to design the new module to be easy to extend and reuse.
  682.          Use blessed references.  Use the two argument form of bless to bless
  683.          into the class name given as the first parameter of the constructor,
  684.          e.g.,:
  685.  
  686.           sub new {
  687.                  my $class = shift;
  688.                  return bless {}, $class;
  689.           }
  690.  
  691.          or even this if you'd like it to be used as either a static or a
  692.          virtual method.
  693.  
  694.           sub new {
  695.                  my $self  = shift;
  696.                  my $class = ref($self) || $self;
  697.                  return bless {}, $class;
  698.           }
  699.  
  700.          Pass arrays as references so more parameters can be added later (it's
  701.          also faster).  Convert functions into methods where appropriate.
  702.          Split large methods into smaller more flexible ones.  Inherit methods
  703.          from other modules if appropriate.
  704.  
  705.          Avoid class name tests like: die "Invalid" unless ref $ref eq 'FOO'.
  706.          Generally you can delete the "eq 'FOO'" part with no harm at all.
  707.          Let the objects look after themselves! Generally, avoid hard-wired
  708.          class names as far as possible.
  709.  
  710.          Avoid $r->Class::func() where using @ISA=qw(... Class ...) and $r-
  711.          >func() would work (see the _p_e_r_l_b_o_t manpage for more details).
  712.  
  713.          Use autosplit so little used or newly added functions won't be a
  714.          burden to programs that don't use them. Add test functions to the
  715.          module after __END__ either using AutoSplit or by saying:
  716.  
  717.           eval join('',<main::DATA>) || die $@ unless caller();
  718.  
  719.          Does your module pass the 'empty subclass' test? If you say
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  731.  
  732.  
  733.  
  734.          "@SUBCLASS::ISA = qw(YOURCLASS);" your applications should be able to
  735.          use SUBCLASS in exactly the same way as YOURCLASS.  For example, does
  736.          your application still work if you change:  $obj = new YOURCLASS;
  737.          into: $obj = new SUBCLASS; ?
  738.  
  739.          Avoid keeping any state information in your packages. It makes it
  740.          difficult for multiple other packages to use yours. Keep state
  741.          information in objects.
  742.  
  743.          Always use ----wwww. Try to use strict; (or use strict qw(...);).  Remember
  744.          that you can add no strict qw(...); to individual blocks of code that
  745.          need less strictness. Always use ----wwww. Always use ----wwww!  Follow the
  746.          guidelines in the _p_e_r_l_s_t_y_l_e(1) manual.
  747.  
  748.      Some simple style guidelines
  749.          The perlstyle manual supplied with Perl has many helpful points.
  750.  
  751.          Coding style is a matter of personal taste. Many people evolve their
  752.          style over several years as they learn what helps them write and
  753.          maintain good code.  Here's one set of assorted suggestions that seem
  754.          to be widely used by experienced developers:
  755.  
  756.          Use underscores to separate words.  It is generally easier to read
  757.          $var_names_like_this than $VarNamesLikeThis, especially for non-
  758.          native speakers of English. It's also a simple rule that works
  759.          consistently with VAR_NAMES_LIKE_THIS.
  760.  
  761.          Package/Module names are an exception to this rule. Perl informally
  762.          reserves lowercase module names for 'pragma' modules like integer and
  763.          strict. Other modules normally begin with a capital letter and use
  764.          mixed case with no underscores (need to be short and portable).
  765.  
  766.          You may find it helpful to use letter case to indicate the scope or
  767.          nature of a variable. For example:
  768.  
  769.           $ALL_CAPS_HERE   constants only (beware clashes with Perl vars)
  770.           $Some_Caps_Here  package-wide global/static
  771.           $no_caps_here    function scope my() or local() variables
  772.  
  773.          Function and method names seem to work best as all lowercase.  e.g.,
  774.          $obj->as_string().
  775.  
  776.          You can use a leading underscore to indicate that a variable or
  777.          function should not be used outside the package that defined it.
  778.  
  779.      Select what to export.
  780.          Do NOT export method names!
  781.  
  782.          Do NOT export anything else by default without a good reason!
  783.  
  784.          Exports pollute the namespace of the module user.  If you must export
  785.          try to use @EXPORT_OK in preference to @EXPORT and avoid short or
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  797.  
  798.  
  799.  
  800.          common names to reduce the risk of name clashes.
  801.  
  802.          Generally anything not exported is still accessible from outside the
  803.          module using the ModuleName::item_name (or $blessed_ref->method)
  804.          syntax.  By convention you can use a leading underscore on names to
  805.          indicate informally that they are 'internal' and not for public use.
  806.  
  807.          (It is actually possible to get private functions by saying:  my
  808.          $subref = sub { ... };  &$subref;.  But there's no way to call that
  809.          directly as a method, because a method must have a name in the symbol
  810.          table.)
  811.  
  812.          As a general rule, if the module is trying to be object oriented then
  813.          export nothing. If it's just a collection of functions then
  814.          @EXPORT_OK anything but use @EXPORT with caution.
  815.  
  816.      Select a name for the module.
  817.          This name should be as descriptive, accurate, and complete as
  818.          possible.  Avoid any risk of ambiguity. Always try to use two or more
  819.          whole words.  Generally the name should reflect what is special about
  820.          what the module does rather than how it does it.  Please use nested
  821.          module names to group informally or categorize a module.  There
  822.          should be a very good reason for a module not to have a nested name.
  823.          Module names should begin with a capital letter.
  824.  
  825.          Having 57 modules all called Sort will not make life easy for anyone
  826.          (though having 23 called Sort::Quick is only marginally better :-).
  827.          Imagine someone trying to install your module alongside many others.
  828.          If in any doubt ask for suggestions in comp.lang.perl.misc.
  829.  
  830.          If you are developing a suite of related modules/classes it's good
  831.          practice to use nested classes with a common prefix as this will
  832.          avoid namespace clashes. For example: Xyz::Control, Xyz::View,
  833.          Xyz::Model etc. Use the modules in this list as a naming guide.
  834.  
  835.          If adding a new module to a set, follow the original author's
  836.          standards for naming modules and the interface to methods in those
  837.          modules.
  838.  
  839.          To be portable each component of a module name should be limited to
  840.          11 characters. If it might be used on MS-DOS then try to ensure each
  841.          is unique in the first 8 characters. Nested modules make this easier.
  842.  
  843.      Have you got it right?
  844.          How do you know that you've made the right decisions? Have you picked
  845.          an interface design that will cause problems later? Have you picked
  846.          the most appropriate name? Do you have any questions?
  847.  
  848.          The best way to know for sure, and pick up many helpful suggestions,
  849.          is to ask someone who knows. Comp.lang.perl.misc is read by just
  850.          about all the people who develop modules and it's the best place to
  851.          ask.
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  863.  
  864.  
  865.  
  866.          All you need to do is post a short summary of the module, its purpose
  867.          and interfaces. A few lines on each of the main methods is probably
  868.          enough. (If you post the whole module it might be ignored by busy
  869.          people - generally the very people you want to read it!)
  870.  
  871.          Don't worry about posting if you can't say when the module will be
  872.          ready - just say so in the message. It might be worth inviting others
  873.          to help you, they may be able to complete it for you!
  874.  
  875.      README and other Additional Files.
  876.          It's well known that software developers usually fully document the
  877.          software they write. If, however, the world is in urgent need of your
  878.          software and there is not enough time to write the full documentation
  879.          please at least provide a README file containing:
  880.  
  881.      +o A description of the module/package/extension etc.
  882.  
  883.      +o A copyright notice - see below.
  884.  
  885.      +o Prerequisites - what else you may need to have.
  886.  
  887.      +o How to build it - possible changes to Makefile.PL etc.
  888.  
  889.      +o How to install it.
  890.  
  891.      +o Recent changes in this release, especially incompatibilities
  892.  
  893.      +o Changes / enhancements you plan to make in the future.
  894.  
  895.                    If the README file seems to be getting too large you may
  896.                    wish to split out some of the sections into separate files:
  897.                    INSTALL, Copying, ToDo etc.
  898.  
  899.      Adding a Copyright Notice.
  900.              How you choose to license your work is a personal decision.  The
  901.              general mechanism is to assert your Copyright and then make a
  902.              declaration of how others may copy/use/modify your work.
  903.  
  904.              Perl, for example, is supplied with two types of licence: The GNU
  905.              GPL and The Artistic Licence (see the files README, Copying, and
  906.              Artistic).  Larry has good reasons for NOT just using the GNU
  907.              GPL.
  908.  
  909.              My personal recommendation, out of respect for Larry, Perl, and
  910.              the Perl community at large is to state something simply like:
  911.  
  912.               Copyright (c) 1995 Your Name. All rights reserved.
  913.               This program is free software; you can redistribute it and/or
  914.               modify it under the same terms as Perl itself.
  915.  
  916.              This statement should at least appear in the README file. You may
  917.              also wish to include it in a Copying file and your source files.
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  929.  
  930.  
  931.  
  932.              Remember to include the other words in addition to the Copyright.
  933.  
  934.      Give the module a version/issue/release number.
  935.              To be fully compatible with the Exporter and MakeMaker modules
  936.              you should store your module's version number in a non-my package
  937.              variable called $VERSION.  This should be a floating point number
  938.              with at least two digits after the decimal (i.e., hundredths,
  939.              e.g, $VERSION = "0.01").  Don't use a "1.3.2" style version.  See
  940.              Exporter.pm in Perl5.001m or later for details.
  941.  
  942.              It may be handy to add a function or method to retrieve the
  943.              number.  Use the number in announcements and archive file names
  944.              when releasing the module (ModuleName-1.02.tar.Z).  See perldoc
  945.              ExtUtils::MakeMaker.pm for details.
  946.  
  947.      How to release and distribute a module.
  948.              It's good idea to post an announcement of the availability of
  949.              your module (or the module itself if small) to the
  950.              comp.lang.perl.announce Usenet newsgroup.  This will at least
  951.              ensure very wide once-off distribution.
  952.  
  953.              If possible you should place the module into a major ftp archive
  954.              and include details of its location in your announcement.
  955.  
  956.              Some notes about ftp archives: Please use a long descriptive file
  957.              name that includes the version number. Most incoming directories
  958.              will not be readable/listable, i.e., you won't be able to see
  959.              your file after uploading it. Remember to send your email
  960.              notification message as soon as possible after uploading else
  961.              your file may get deleted automatically. Allow time for the file
  962.              to be processed and/or check the file has been processed before
  963.              announcing its location.
  964.  
  965.              FTP Archives for Perl Modules:
  966.  
  967.              Follow the instructions and links on
  968.  
  969.                 http://franz.ww.tu-berlin.de/modulelist
  970.  
  971.              or upload to one of these sites:
  972.  
  973.                 ftp://franz.ww.tu-berlin.de/incoming
  974.                 ftp://ftp.cis.ufl.edu/incoming
  975.  
  976.              and notify <_u_p_l_o_a_d@_f_r_a_n_z._w_w._t_u-_b_e_r_l_i_n._d_e>.
  977.  
  978.              By using the WWW interface you can ask the Upload Server to
  979.              mirror your modules from your ftp or WWW site into your own
  980.              directory on CPAN!
  981.  
  982.              Please remember to send me an updated entry for the Module list!
  983.  
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  995.  
  996.  
  997.  
  998.      Take care when changing a released module.
  999.              Always strive to remain compatible with previous released
  1000.              versions.  Otherwise try to add a mechanism to revert to the old
  1001.              behaviour if people rely on it. Document incompatible changes.
  1002.  
  1003.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr CCCCoooonnnnvvvveeeerrrrttttiiiinnnngggg PPPPeeeerrrrllll 4444 LLLLiiiibbbbrrrraaaarrrryyyy SSSSccccrrrriiiippppttttssss iiiinnnnttttoooo MMMMoooodddduuuulllleeeessss
  1004.  
  1005.      There is no requirement to convert anything.
  1006.          If it ain't broke, don't fix it! Perl 4 library scripts should
  1007.          continue to work with no problems. You may need to make some minor
  1008.          changes (like escaping non-array @'s in double quoted strings) but
  1009.          there is no need to convert a .pl file into a Module for just that.
  1010.  
  1011.      Consider the implications.
  1012.          All Perl applications that make use of the script will need to be
  1013.          changed (slightly) if the script is converted into a module.  Is it
  1014.          worth it unless you plan to make other changes at the same time?
  1015.  
  1016.      Make the most of the opportunity.
  1017.          If you are going to convert the script to a module you can use the
  1018.          opportunity to redesign the interface. The 'Guidelines for Module
  1019.          Creation' above include many of the issues you should consider.
  1020.  
  1021.      The pl2pm utility will get you started.
  1022.          This utility will read *.pl files (given as parameters) and write
  1023.          corresponding *.pm files. The pl2pm utilities does the following:
  1024.  
  1025.      +o Adds the standard Module prologue lines
  1026.  
  1027.      +o Converts package specifiers from ' to ::
  1028.  
  1029.      +o Converts die(...) to croak(...)
  1030.  
  1031.      +o Several other minor changes
  1032.  
  1033.                    Being a mechanical process pl2pm is not bullet proof. The
  1034.                    converted code will need careful checking, especially any
  1035.                    package statements.  Don't delete the original .pl file
  1036.                    till the new .pm one works!
  1037.  
  1038.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr RRRReeeeuuuussssiiiinnnngggg AAAApppppppplllliiiiccccaaaattttiiiioooonnnn CCCCooooddddeeee
  1039.  
  1040.      Complete applications rarely belong in the Perl Module Library.
  1041.  
  1042.      Many applications contain some Perl code that could be reused.
  1043.          Help save the world! Share your code in a form that makes it easy to
  1044.          reuse.
  1045.  
  1046.      Break-out the reusable code into one or more separate module files.
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  1061.  
  1062.  
  1063.  
  1064.      Take the opportunity to reconsider and redesign the interfaces.
  1065.  
  1066.      In some cases the 'application' can then be reduced to a small
  1067.          fragment of code built on top of the reusable modules. In these cases
  1068.          the application could invoked as:
  1069.  
  1070.               % perl -e 'use Module::Name; method(@ARGV)' ...
  1071.          or
  1072.               % perl -mModule::Name ...    (in perl5.002 or higher)
  1073.  
  1074.  
  1075. NNNNOOOOTTTTEEEE
  1076.      Perl does not enforce private and public parts of its modules as you may
  1077.      have been used to in other languages like C++, Ada, or Modula-17.  Perl
  1078.      doesn't have an infatuation with enforced privacy.  It would prefer that
  1079.      you stayed out of its living room because you weren't invited, not
  1080.      because it has a shotgun.
  1081.  
  1082.      The module and its user have a contract, part of which is common law, and
  1083.      part of which is "written".  Part of the common law contract is that a
  1084.      module doesn't pollute any namespace it wasn't asked to.  The written
  1085.      contract for the module (A.K.A. documentation) may make other provisions.
  1086.      But then you know when you use RedefineTheWorld that you're redefining
  1087.      the world and willing to take the consequences.
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.                                                                        PPPPaaaaggggeeee 11118888
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.