Module::Starter, a replacement for h2xs

petdance on 2004-04-05T03:48:12

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 --email=andy@petdance.com --author="Andy Lester"

$ find Foo Foo Foo/.cvsignore Foo/Changes Foo/lib Foo/lib/Foo Foo/lib/Foo/Bar.pm Foo/lib/Foo/Bat.pm Foo/lib/Foo.pm Foo/Makefile.PL Foo/MANIFEST Foo/t Foo/t/00.load.t Foo/t/pod-coverage.t Foo/t/pod.t

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

WriteMakefile( NAME => 'Foo', AUTHOR => 'Andy Lester ', VERSION_FROM => 'lib/Foo.pm', ABSTRACT_FROM => 'lib/Foo.pm', PREREQ_PM => { 'Test::More' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Foo-*' }, );
Comments are welcome, and expected.


Looks Good

tmtm on 2004-04-05T09:36:20

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 bug-test-html-tidy@rt.cpan.org? :)

Tony

Re:Looks Good

barbie on 2004-04-05T11:33:12

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.

Re:Looks Good

petdance on 2004-04-05T18:53:10

(And are bugs *really* to be reported to bug-test-html-tidy@rt.cpan.org?

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

Multiple periods in filenames...

rooneg on 2004-04-05T14:55:43

Might want to avoid the 00.blah.t style names for the tests. Multiple periods in filenames tend to screw up VMS systems, IIRC.

ExtUtils::ModuleMaker

jbisbee on 2004-04-05T15:19:39

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.

Re:ExtUtils::ModuleMaker

petdance on 2004-04-05T18:53:50

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

Re:ExtUtils::ModuleMaker

jbisbee on 2004-04-05T20:42:59

On search.cpan.org, 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').

Re:ExtUtils::ModuleMaker

perigrin on 2004-04-07T16:27:14

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 search.cpan.org ... 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).

Re:ExtUtils::ModuleMaker

brian_d_foy on 2004-04-13T17:47:15

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.