http://www.perlmonks.org?node_id=694230

jblakey has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've got a rather large in-house module tree that i've automated the building/packing/pushing-out of. Usually, to create a new module in perl 5.6, i use "h2xs -AXn This::Module::Name", and this directory structure gets created...

./This/Module/Name/

Now, in perl 5.8 and later, i've noticed h2xs produces a flatter structure:

./This-Module-Name/

Is there anyway to force the multi-level path creation in perl 5.8? I don't really want to have to redo all my module stuff just because of this change (although, i suppose i could write my own crappy h2xs-module-making-kinda-thingy as somewhat of a last resort). This is on Windows, by the way...

Thanks for listening,
jason

Replies are listed 'Best First'.
Re: Module Building 5.6 vs 5.8 or 5.10
by tachyon-II (Chaplain) on Jun 26, 2008 at 18:25 UTC

    The structure now generated by h2xs is not actually flat. It is:

    This-Module-Name/ This-Module-Name/lib/ This-Module-Name/lib/This/ This-Module-Name/lib/This/Module/ This-Module-Name/lib/This/Module/Name.pm This-Module-Name/Makefile.PL This-Module-Name/Changes This-Module-Name/t etc

    Other changes include using Test::More rather than Test....

    You can specify --compat-version=5.x.x but if you want all the old behaviour (including the horrid old directory structure) then you probably need to use an old version of h2xs.

Re: Module Building 5.6 vs 5.8 or 5.10
by polettix (Vicar) on Jun 26, 2008 at 18:38 UTC
    I don't know much about h2xs just because there's Module::Starter (and its companion Module::Starter::PBP). It's meant as a replacement that will give you the possibility of customising many aspects of the newly created modules, e.g. put your name into the right place (instead of A.U.Thor) or your preferred disclaimer text. Higly recommended.

    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?
Re: Module Building 5.6 vs 5.8 or 5.10
by educated_foo (Vicar) on Jun 27, 2008 at 18:43 UTC
    h2xs adds more and more extraneous garbage with each release, so I finally gave up and whipped up my own module creation script. It's only about 120 lines, and only took a little while to write, so I consider it time well spent. If you write more than a few modules, I suggest you do the same.
Re: Module Building 5.6 vs 5.8 or 5.10
by Anonymous Monk on Jun 27, 2008 at 04:40 UTC