Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Sunday April 04, 2004
10:48 PM

Module::Starter, a replacement for h2xs

[ #18201 ]
I've just released Module::Starter 0.02, meant as a replacement for h2xs.

I think h2xs is very out of date as far as current best practices for modules. It's also very intimidating for people who just want to create a module, and have no need for all the compiler hoohah that h2xs throws at you. Module::Starter is meant to make things much eaiser.

Here's a sample run of Module::Starter's command-line program:

$ module-starter --module=Foo,Foo::Bar,Foo::Bat --author="Andy Lester"

$ find Foo
Foo/t /00.load.t

$ cat Foo/Makefile.PL
use strict;
use warnings;
use ExtUtils::MakeMaker;

    NAME                => 'Foo',
    AUTHOR              => 'Andy Lester <>',
    VERSION_FROM        => 'lib/',
    ABSTRACT_FROM       => 'lib/',
    PREREQ_PM => {
        'Test::More' => 0,
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Foo-*' },

Comments are welcome, and expected.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Ideally there'd be a local config file that would save me having to type my own name and email address all the time. And overridable templates for what I'd like in my modules, MANIFEST.skip, extra default tests etc. (And are bugs *really* to be reported to :) Tony
    • Personally I also like a README in there. I note that the POD on CPAN [] is difficult to read, perhaps it might be worth adding a cheat, something like 'Below is the example layout of the POD', with a few choice '----' to highlight the block. Or is there a way to stop that from happening ?

      I definitely like Tony's idea of a configuration file. Perhaps something like the one the cpan-upload [] script uses.

    • (And are bugs *really* to be reported to

      Nope, and it highlights the danger of how I've been doing new module creation: Cut & paste from an existing good module.



  • Might want to avoid the 00.blah.t style names for the tests. Multiple periods in filenames tend to screw up VMS systems, IIRC.
  • Geoff Avery has ExtUtils::ModuleMaker [], a replacement for h2xs.

    It hasn't been updated in awhile and I do like the name Module::Starter better. Just wanted to bring it to your attention if you didn't know about it.



    • Any others that I don't know about? obra claimed "~dozen" existing similar packages, but that seems high.


      • On, just did a search for h2xs and skimmed the results. ExUtils::ModuleMaker seems like the only one that I could find.

        I take back not being recently updated, Geoff updated it in June of 2003 (during the last YAPC::NA in Boca Raton where he did a presentation on it)

        Kinda like does what you want with the command line tool 'modulemaker' (reminds me of brian d foy's 'release').



      • Barries has Module::Husbandry but I think it's been abandoned in the face of his paid work getting in the way.

        Ron Savage has Module::MakeDist

        Jonas B. Neilson has Module::Template::Setup

        Those were the ones I found by doing a search of "Module" on ... note that I have used Barries Module::Husbandry and it has some nice command line tools for moving files into and out of packages (and I can attest it works under Windows despite the POD).

      • There is Mark Fowler's mmm script (which has the template support that other people asked for), and I am still working on my scriptdist script which I have been using to do the same thing.

        When I was researching this for an upcoming TPJ article, I found all sorts of prior implementations, most of which are not on CPAN. As with a lot of things people hack on something to get what they want, and that is where their work stops.