CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in
Add ListingModify ListingTell A FriendLink to TPASubscribeNew ListingsCool ListingsTop RatedRandom Link
Newest Reviews
  • review
  • hagen software
  • NOT GPL!
  • Hagan Software
  • Wasted Time with ...
  • poor pre-sale sup...
  • no response
  • rating the offer
  • Good Stuff
  • Good idea but use...


  •  
    Perl Archive : TLC : Book Reviews : Writing Perl Modules for CPAN
    Guide Search entire directory 
     

    Date Published: 2002-08-30

    TStanley writes " Originally posted at www.perlmonks.org

    The author starts off with a quick overview of the CPAN, describing its purpose, design, and history. He also describes how to browse, search, and install modules from the CPAN, using the CPAN module from the Perl distribution. He also makes note of the Perl Package Manager (PPM) from ActiveState, and gives short examples on how to use it.

    Author: Sam Tregar
    Contents
    • About the Author
    • About the Technical Reviewer
    • Acknowledgements
    • Introduction
    1. CPAN
    2. Perl Module Basics
    3. Module Design and Implementation
    4. CPAN Module Distributions
    5. Submitting your Module to CPAN
    6. Module Maintenance
    7. Great CPAN Modules
    8. Programming Perl in C
    9. Writing C Modules with XS
    10. Writing C Modules with Inline::C
    11. CGI Application Modules for CPAN
    • Index

    The second chapter deals with the basic workings of modules, such as packages and symbol tables, and makes note of where the differences between Unix and Windows exist when applicable. He also covers the basics used in most common modules, such as tying scalars, hashes, and arrays, operator overloading, and the basics of object oriented programming.

    The third chapter covers the design and implementation of modules. He starts off with the point of checking CPAN for existing modules. “CPAN is the greatest enabler of programmer laziness since the terminal!” He also makes an excellent point for documenting the module first. “If you can explain it in the docs, then there’s a good chance you’ll be able to code it”. Also covered in this chapter are parameter passing, exporting, and inheritance. He also makes use of the Class::Struct and Class::MethodMaker modules, which can be found on CPAN.

    Chapter 4 touches on module installation as well as creation. For creating a basic template for a module, the author emphasizes the point of “Always begin with h2xs.” As he points out, it will save the programmer a lot of trouble, and he goes into some detail about its most commonly used options and the files that are produced from them.

    Chapters 5 and 6 deal with actually submitting your module to CPAN, and some general guidelines and ideas, to help maintain the module once it is submitted. He discusses the Perl Authors Upload Server (PAUSE), how to obtain a CPAN ID, and registering your namespace. For the maintenance side of things, he covers the various methods used, such as email lists, emailing the author, using the diff command to generate patches, and refactoring of code. He also touches upon the Concurrent Version System (CVS), describing what it does, where it can be found, and giving some basic commands for its usage.

    Chapter 7 is a showcase of some of the most well known (if not most used) modules found on CPAN. Listed in the number one spot is the CGI module, followed by DBI and Storable. Also listed are Net::FTP, LWP, XML::SAX, and Parse::RecDescent.

    The next three chapters deal with programming with C and with XS. And both are subjects the author is obviously quite familiar and comfortable with. He covers the basics of the Perl C API, and works with the Gnome::MIME module in his chapter on XS. He also uses the Inline::C module to insert C code into the middle of a perl module.

    The final chapter of the book deals with the CGI::Application module, which allows the programmer to create flexible code that can be used on multiple projects.

    Overall, this book was very well written, with no obvious errors or typos, and the material was up-to-date. The only problem I had with this book, was that I felt not enough information regarding the creation of modules for Windows distribution was given out. However, the author did point out in the beginning of the book that it was primarily geared towards the Unix distributions.

    I would heartily recommend this book to anyone who is considering releasing a module to CPAN.

     
     


    About The Perl ArchiveLink Validation ProcessSearch Tips
    Web Applications & Managed Hosting Powered by Gossamer Threads
    Visit our Mailing List Archives