O'Reilly logo

Learning Perl Objects, References, and Modules by Tom Phoenix, Randal L. Schwartz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Writing a Distribution

In Chapter 12, you created a fictional Island::Plotting::Maps module, and built the right support for Exporter so that you could include use Island::Plotting::Maps in a program.

While the resulting .pm file is useful, it’s not very practical. There’s a lot more to building a real module than just creating the .pm file. You’ll also need to consider and implement the following questions:

Installation location

How and where is the .pm file installed so a program can find the module in its @INC path?

Documentation

Where is the documentation for the module? How is the documentation installed so the user can read it?

Archive completeness

If there are any accompanying files, where are they? How can the end user know if any missing files are missing?

Testing

What test harnesses can the developer run to verify correct operation, including testing against older known bugs? Can these same tests be run by the installer to ensure proper operation in the target environment?

C-language interfaces

If the module contains C or C++ code (not covered here), how can the developer describe how to compile and link the code in the developer’s environment, or the end user environment?

As Roy Scheider uttered in the movie Jaws: “You’re gonna need a bigger boat.” That “bigger boat” is the difference between a module and a distribution.

Starting with h2xs

A distribution contains the module (or collection of related modules), plus all the support files required to document, test, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required