Writing Perl Modules for CPAN

Sam Tregar

Apress

Writing Perl Modules for CPAN

Copyright © 2002 Sam Tregar

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.

1-59059-018-X

Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.

Technical Reviewers: Jesse Erlbaum and Neil Watkiss
Editorial Directors: Dan Appleman, Gary Cornell, Jason Gilmore, Simon Hayes, Karen Watterson, John Zukowski
Managing Editor and Production Editor: Grace Wong
Project Managers: Erin Mulligan, Alexa Stuart
Copy Editor: Ami Knox
Proofreader: Brendan Sanchez
Compositor: Susan Glinert
Indexer: Valerie Perry
Cover Designer: Kurt Krames
Manufacturing Manager: Tom Debolski
Marketing Manager: Stephanie Rodriguez

Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 175 Fifth Avenue, New York, NY, 10010 and outside the United States by Springer-Verlag GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany.

In the United States, phone 1-800-SPRINGER, email orders@springer-ny.com, or visit http://www.springer-ny.com.

Outside the United States, fax +49 6221 345229, email orders@springer.de, or visit http://www.springer.de.

For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax: 510-549-5939, email info@apress.com, or visit http://www.apress.com.

The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.

The source code for this book is available to readers at http://www.apress.com in the Downloads section. You will need to answer questions pertaining to this book in order to successfully download the code.

In memory of Luke and to Kristen who introduced us

About the Author

SAM TREGAR has been working as a Perl programmer for four years. He is currently employed by About.com in the PIRT group, where he develops content management systems. Sam holds a bachelor of arts degree in computer science from New York University.

Sam started programming on an Apple IIc in BASIC when he was 10 years old. Over the years his love of technical manuals led him through C, C++, Lisp, TCL/Tk, Ada, Java, and ultimately to Perl. In Perl he found a language with flexibility and power to match his ambitious designs. Sam is the author of a number of popular Perl modules on CPAN including HTML::Template, HTML::Pager, Inline::Guile, and Devel::Profiler. The great enjoyment he derives from contributing to CPAN motivated him to write this book, his first.

Aside from programming, Sam enjoys reading, playing Go, developing black- and-white photographs, thinking about sailing, and maintaining the small private zoo curated by his wife that contains three cats, two mice, two rats, one snake, and one rabbit.

Sam lives with his wife Kristen in Croton-on-Hudson, New York. You can reach him by e-mail at sam@tregar.com or by visiting his home page at http://www.sam.tregar.com.

About the Technical Reviewers

JESSE ERLBAUM has been developing software professionally since 1994. He has developed custom software for a variety of clients including Time, Inc., the WPP Group, the Asia Society, and the United Nations. While in elementary school, Jesse was introduced to computer programming. It became his passion instantly, and by the time he was in middle school, he wrote and presented a "learning" program to his class to satisfy a science assignment. In 1989, he started his own bulletin board system (BBS), "The Belfry(!)", which quickly attracted a cult of regulars who enjoyed its vibrant and creative environment.

Jesse's enthusiasm for the World Wide Web was the natural result of the intersection of his two principal interests at the time, online communities and programming. Over the next few years, as the state of the art grew to embrace more interactive capabilities, he focused his efforts on building the systems and standards from which his clients increasingly benefited. In 1997, he established a library of reusable, object-oriented Perl libraries called "Dynexus", which was the foundation upon which he developed Web-based, database-connected systems.

It was during this period that Jesse met Sam Tregar. For two years Sam and Jesse worked together on a variety of custom software systems. In 1999, Jesse encouraged Sam to release HTML::Template (originally Dynexus::HTML::Template) to CPAN. In July 2000 Sam returned the favor, encouraging Jesse to release CGI::Application (originally Dynexus::OOCGI::Standard). CGI::Application is a framework for building Web-based applications. This framework has been adopted by a wide array of organizations around the world as the basis for their Web- development efforts.

Jesse is the CEO and founder of The Erlbaum Group, a software engineering and consulting firm in New York City. He can be reached by e-mail at jesse@erlbaum.net.

NEIL WATKISS is a Perl developer at ActiveState. He has a degree in computer engineering, and fell in love with Perl while maintaining a community Linux server in university. While at ActiveState, Neil met Brian Ingerson and was recruited to help work on the award-winning Inline module. Now the author of several Inline modules, Neil continues to delve into the Perl internals on a regular basis. He has worked on ActiveState's regular expression debugger, a Perl milter plug-in for Sendmail, and an automated Perl package build system for ActiveState's PPM (Perl Package Manager) repository.

Acknowledgments

FIRST AND FOREMOST I would like to thank my wife, Kristen, for patience and for-bearance above and beyond reasonable limits. I would also like to thank our horse, Rhiannon, for giving her something to do while I worked. My parents, Jack and Rosemary, supported me in numerous ways throughout the writing of the book. In particular I would like to thank my father for the prescient advice he often gave me, "Write if you get work." All the members of my and Kristen's family gave me encouragement, for which I am grateful.

I must thank Jesse Erlbaum, who served as the chief technical editor for this book. However, his contributions to my life began years ago. When I came to work for Jesse at Vanguard Media in 1999, I knew plenty about coding but very little about being a programmer. Jesse took me under his wing and taught me how to be a professional, how to value quality in my work, and how to demand it from others. Under his direction I published my first CPAN module—HTML::Template—which is based on his work. Jesse's friendship, humor, and advice have been indispensable to me; that he helped me complete this book is but the latest in a long series of kindnesses.

Neil Watkiss joined our team as a technical editor during the crucial final weeks. Under extreme pressure he delivered admirably. Without his help the book might never have been completed.

The people I worked with at Apress did a great job on the book and kept me motivated throughout the project. Jason, Grace, Alexa, Ami, Erin, Stephanie, Doris, Susan, Kari—thanks!

My friends put up with my haggard face on many occasions during the writing of this book. They even managed to seem interested when I would describe it at length and in mind-numbing detail. Chris, Sean, Catherine, Mia, Fritz, Nat, Jarett, Carson, Danielle, Fran, Agneta—thank you all. I plan to become human again soon and look forward to seeing you all more often.

My coworkers at About.com were often helpful and always patient when I couldn't keep the stress from showing. Len, Peter, Rudy, Matt, Adam, Lou, Rachel, Nathan, Tim—thank you.

I would like to thank Larry Wall for giving us both Perl and the Perl community. Without his work, I'm certain the programming world would be a much less interesting place. I must also thank Jarkko Hietaniemi and Andreas J. Köenig for giving the Perl community CPAN and also for patiently answering my questions about its history. I'd also like to thank the many developers who contribute to CPAN and maintain Perl. In particular, the following people answered my questions and provided me with invaluable insight into the minds behind Perl: Elaine Ashton, Damian Conway, Jochen Wiedmann, Raphael Manfredi, Steffen Beyer, James G. Smith, Ken Williams, Mark-Jason Dominus, Michael G. Schwern, Simon Cozens, Barrie Slaymaker, Graham Barr, Lincoln D. Stein, Matt Sergeant, Sean M. Burke, T.J. Mather, and Rich Bowen.

I must thank Brian Ingerson for assisting me in the early development of the book. Scott Guelich, author of CGI Programming with Perl, also deserves special mention—his early encouragement was crucial to getting the project off the ground. Finally, I would like to thank Leon Brocard for allowing me to use his CPAN network illustration, a version of which appears in Chapter 1.



Writing Perl Modules for CPAN
Writing Perl Modules for CPAN
ISBN: 159059018X
EAN: 2147483647
Year: 2002
Pages: 110
Authors: Sam Tregar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net