Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Module::Starter, a helper for new module authors

by petdance (Parson)
on Apr 05, 2004 at 03:54 UTC ( #342564=perlnews: print w/ replies, xml ) Need Help??

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 <andy@petdance.com>', 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.

xoxo,
Andy

Comment on Module::Starter, a helper for new module authors
Download Code
Re: Module::Starter, a helper for new module authors
by adrianh (Chancellor) on Apr 05, 2004 at 04:27 UTC
    I think h2xs is very out of date as far as current best practices for modules.

    With the appropriate arguments, the modern h2xs isn't all that bad. Having alias newmodule h2xs --use-new-tests -AXn gets you most of the way there.

    And shouldn't we be pushing Module::Build these days :-)

      Module::Build patches are welcome.

      xoxo,
      Andy

        Module::Build patches are welcome.

        My - that was quick :-)

        From the 0.04 Changes:

        * Added support for Module::Build. Thanks, Randy Sims.

        Isn't open source great!

      And shouldn't we be pushing Module::Build these days :-)

      Not yet. Module::Build is a huge pain right now because it doesn't come standard with Perl. When it ships with perl, it will be a reasonable option, but it still irks me that it can't take the same flags (e.g. PREFIX) which we have been trying to teach to newbies without root for eons now.

        Not yet. Module::Build is a huge pain right now because it doesn't come standard with Perl.

        Passthrough Makefile.PLs and auto-installation have worked well in solving the installation issue for me.

        When it ships with perl, it will be a reasonable option

        It's planned to ship with 5.10 - whenever that may be ;-)

        Just as an information point there were over 150 distinct distributions that used Module::Build on CPAN back in October 2003. Probably more now. So there's obviously a section of the Perl world who think it's a reasonable option now. YMMV.

        All the reports I've read from authors who have switched (e.g. Mark Stosberg) say that few, if any, complaints were received.

        it still irks me that it can't take the same flags (e.g. PREFIX) which we have been trying to teach to newbies without root for eons now

        Yeah that is a bit of a pain. It's a swings/roundabouts situation. M::B has a much more sensible structure for installation prefixes than the baroque logic that EU::MM uses. So what's better: use PREFIX and annoy people who expect an exact match for the old behaviour, or change the name and annoy people who have to go read the docs to find out the new mechanism.

        My opinion changes depending on the day of the week.

      Please God no. Module::Build (0.23, Mac OS 10.2.8, Perl 5.8.3) has been a plague to me by failing to work with CPAN installs, while ExtUtils::MakeMaker has always treated me well. Maybe there are good reasons to head toward M::B, but from looking at the "motivation" section of the POD, I'm not so convinced. (Disclaimer: I am not, nor have I ever been, a Windows user.)

      It claims that "Perl is said to be a language for system administration. Could it really be the case that Perl isn't up to the task of building and installing software?" This absolutely grates -- Perl is about text manipulation and system administration, but it's also about gluing existing parts together. If there's a tried-and-true wheel out there, Perl can usually take advantage of it, rather than having to reinvent it. Even if M::B is made to work as well as make at the moment, it will lead to a constant duplication of effort as platforms change, so long as other projects continue to use make, and therefore keep it up-to-date. As it says in the M::B docs, "It is risky to make major changes to MakeMaker, since it does so many things, is so important, and generally works." So on the one hand, there is crufty code; on the other hand, I appreciate its "generally working." (This sounds like a Perl 5/6 comparison in some ways, and I see neither an effort to convert people to Perl 6 by subtle default, nor a cry that they adopt it simply "because it's new".)

      For people who need to do elaborate tweaks to the build process, M::B sounds like a definite improvement. But for the rest of us, and certainly for most users of Module::Simple, EU::MM will minimize pain to both author and users.

        Module::Build (0.23, Mac OS 10.2.8, Perl 5.8.3) has been a plague to me by failing to work with CPAN installs

        Try 0.24 - I think you may have hit M::B at a bad time. Both 0.22 and 0.23 had some rather annoying bugs with passthrough Makefile.PLs that caused problems when used with CPAN. I suspect that 0.24 will work fine, as would using CPANPLUS which calls Module::Build directly rather than using the Makefile.PL.

        I've been using M::B on Mac OS X, various Linux varieties, Free BSD and Solaris with no problems.

        Perl is about text manipulation and system administration, but it's also about gluing existing parts together. If there's a tried-and-true wheel out there, Perl can usually take advantage of it, rather than having to reinvent it

        The problem is that there isn't a wheel, there are several. The various make variants all work in slightly different ways. Dealing with this is one of the reasons E:MM is so complex. Dealing with this variety when writing extensions is a pain. Then there are those platforms that don't have that particular wheel by default.

        Next there is the problem that the declarative makefile style isn't always suitable to express the dependencies and processes you want to happen during a build process. So you have to jump backwards and forwards between the makefile and perl code - which is hard.

        Finally there's the problem that EU::MM isn't really built to be extended, so it's a royal PITA for folk like me who need to make custom build processes :-)

        For people who need to do elaborate tweaks to the build process, M::B sounds like a definite improvement. But for the rest of us, and certainly for most users of Module::Simple, EU::MM will minimize pain to both author and users.

        Depends on the author/user I guess ;-) For those platforms that don't come with a make M::B can be a lot simpler. As a CPANPLUS user I have had zero problems using Module::Build. As a module author I vastly prefer it to EU::MM since it's really easy to extend.

Re: Module::Starter, a helper for new module authors
by kvale (Monsignor) on Apr 05, 2004 at 05:07 UTC
      Simplicity, from the looks of it. I'd never seen ExtUtils::ModuleMaker before you linked to it just now.

      xoxo,
      Andy

Re: Module::Starter, a helper for new module authors
by simonm (Vicar) on Apr 05, 2004 at 17:50 UTC
    It seems that search.cpan.org (and maybe other POD parsers) are confused by the POD that's meant to be embedded in the target package, and includes it in the documentation for Module::Starter.

    Putting a backslash before the equal signs in the POD heredoc should do the trick...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://342564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-09-17 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (56 votes), past polls