sethd.org
this is not the blog you're looking for

Resume
LinkedIn

RECENT ENTRIES

Perl and Inline POD
Vim Articles (by Damian Conway)
Interesting Modules 2010-03-05
Dave Rolsky Is Right
Interesting Modules 2010-03-02
Perl Call Semantics
Interesting Modules 2010-03-01
Interesting Modules 2010-02-27
Cleaning Namespaces
Ranting About Yahoo! Mail
Interesting Modules 2010-02-24
Interesting Modules 2010-02-23
Testing A Database Intensive Application
Excellent Post About Exceptions
Interesting Modules 2010-02-22
Interesting Modules 2010-02-21
Setting Up A Windows Computer: Part 2
Los Angeles Boat Show
Interesting Modules 2010-02-19
Interesting Modules 2010-02-17
First Day at New Gig
My Favorite Hike
Initial Picasa Experience
Interesting Modules 2010-02-15
Interesting Modules 2010-02-14
Interesting Modules 2010-02-13
Leaving Oversee
Universal CityWalk
The SheevaPlug and MythTV
Interesting Modules 2010-02-11
Lucky Strike at LA Live
Log Analysis Tools: Part 1
Protocol Buffers and Perl
Perl Profiling
Blosxom and plugins
Module::Build is useful for more than bundling
Test::Builder::Module: Why am I just learning about this?
Downtown Los Angeles
Navigation
ArcLight Cinemas
This Hiking Trail
Sports Blogging
Apache 1.3 End-Of-Life
A Silly Conceit: Perl Is Not Serious
Feb 07, 2010

Module::Build is useful for more than bundling

I don't know how many people use Module::Build for more than bundling of code for CPAN. In fact I've been using it for years to help organize and build up my base of custom modules.

Typically this involves subclassing Module::Build and then adding a number of new features using its API. The documentation isn't terrible (but it could be better), but I'd still recommend looking at the code in Module::Build::Base whenever you are stuck trying to figure something out.

By default Module::Build only knows about a few directories. If you need to have files installed in any other directories than you can either modify the Build.PL file or you can add that information to a subclass and use it across all of your code. I'd recommend the latter. One particularly nice trick is to associate certain directories with XS (or other compiled code) and have Module::Build build it automatically for you.

Another nice thing about using a subclass of Module::Build is that now you can have a central source of file policy. i.e. a central location that dictates that certain files go here and that other types of files go there. Taking this out of the hands of each module is desirable for any project larger than a few modules.

Of the similar modules I have looked at Module::Build is the best. If nothing else it is much better than Makefile.PL.

Tags: , , .
[p] Posted @ 21:00 by Seth


Test::Builder::Module: Why am I just learning about this?

So I have been writing tests for years. I've written a number of modules that do (essentially) what Test::Most does. Yet in all this time I knew nothing of Test::Builder::Module. Argh! This module makes building test modules so easy. No more

  my $caller = caller();
  eval "package $caller; use Test::More";
Instead you can use Test::Builder::Module to do a lot of this. It appears to be an extremely useful module and it's high time I start using it.

Tags: , , , .
[p] Posted @ 20:52 by Seth


This site uses the very simple and easy to use blosxom blogging software.


Advanced Search

OTHER SITES