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

Resume
LinkedIn

RECENT ENTRIES

Interesting Modules 2010-07-30
Recent Interesting Talks
Book Blogging: Bloodbrothers
Book Blogging: Fires of Freedom
Duck Duck Go
Yes, Yes, Yes
About That Lack of Blogging
Using A Smart Phone
Taking the Smart Phone Plunge (Maybe)
Book Blogging: Nemesis
Perl Not Going Away
OpenX Is Hiring Perl Developers
Perl Jobs vs Perl Programmers
Free Chapter From Effective Perl Programming
Perl On Android Progressing
Book Blogging: The Mote In God's Eye
Perldoc Is Important
The Second Age of Perl
A Description of Perl 5.12
Interesting Modules 2010-04-18
The Moral of This Story
Perl 5.12 Has Been Released
Packaging and Maintaining An Alternate Perl
Perl Moving Up?
Building Dependencies Like Make
Introduction To Plack
Defining Standard Testing Methodologies
Subversion Vision Released
Interesting Modules 2010-04-01
Perl Is Thriving
Interesting Modules 2010-03-29
Assign to $0
The Looming Google AdWords Perl Problem: Followup
Subversion Vision
Interesting Modules 2010-03-26
Interesting Modules 2010-03-25
The iPhone and Perl
Perl Is Dying
Setting Up A Windows Computer: Part 3
Trouble Hiring Perl Developers
Back From San Diego 2010
Interesting Modules 2010-03-17
Remember To Use parent Instead of Base
Using Test::Class
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