Creating Perl Modules

Document Sample
Creating Perl Modules Powered By Docstoc
					Creating Perl Modules

      Oct 6th, 2004
               Perl Modules
•   Perl files which have .pm extension
•   Easier to bundle, distribute
•   Easier to test
•   Easier to install
•   Easier to develop
• Create a directory for you module
  – Example:
     • Module Apache::Filter
        – is on directory Apache/Filter/
     • Our Project might be Network::Router,
       Network::Host, Network::Link
        – is in Network/Link/
        – is in Network/Host/
        – is in Network/Router/
    Creating Module Skeleton
• Command line util: h2xs
     mary-kate ~/dave: h2xs -AXc NewModule

     Writing NewModule/
     Writing NewModule/Makefile.PL
     Writing NewModule/README
     Writing NewModule/t/1.t
     Writing NewModule/Changes
     Writing NewModule/MANIFEST
       Installing your module
• The general procedure for installation:

     make test
     make install