http://qs1969.pair.com?node_id=340815


in reply to Re: Re: In praise of h2xs: A tool you gotta have
in thread In praise of h2xs: A tool you gotta have

Michael Schwern, maintainer of ExtUtils::MakeMaker, also called it broken and said he wanted to fix it at some point. It makes a layout which is practical only if you are doing an XS module with an actual compile step. For pure perl modules, it is very annoying to develop within. Either you have to keep installing it every time you edit the file, or you mess with @INC and edit it within the blib/ directory (where it goes when you do the make) and then copy it back into place when you finish. It's even worse if you have multiple modules in your distribution with different namespaces (i.e. Foo::Something and Bar::Something). I have seen people other than me get extremely confused by the h2xs structure. Basically, I can't see a good reason to use when ExtUtils::ModuleMaker exists.

Replies are listed 'Best First'.
Re^4: In praise of h2xs: A tool you gotta have
by adrianh (Chancellor) on Mar 30, 2004 at 12:05 UTC
    Michael Schwern, maintainer of ExtUtils::MakeMaker, also called it broken and said he wanted to fix it at some point.

    While these days I just grab my default module template from my code repository, since at least 5.8 you get a sensible default layout with h2xs:

    % h2xs --use-new-tests -AXn Foo::Bar::Ni Defaulting to backwards compatibility with perl 5.8.3 If you intend this module to be compatible with earlier perl versions, + please specify a minimum perl version with the -b option. Writing Foo-Bar-Ni/lib/Foo/Bar/Ni.pm Writing Foo-Bar-Ni/Makefile.PL Writing Foo-Bar-Ni/README Writing Foo-Bar-Ni/t/Foo-Bar-Ni.t Writing Foo-Bar-Ni/Changes Writing Foo-Bar-Ni/MANIFEST % ls Foo-Bar-Ni/ Changes Makefile.PL lib MANIFEST README t % ls -lR Foo-Bar-Ni/lib total 0 drwxrwxr-x 3 adrianh staff 102 30 Mar 12:52 Foo Foo-Bar-Ni/lib/Foo: total 0 drwxrwxr-x 3 adrianh staff 102 30 Mar 12:52 Bar Foo-Bar-Ni/lib/Foo/Bar: total 8 -rw-rw-r-- 1 adrianh staff 1756 30 Mar 12:52 Ni.pm
    Either you have to keep installing it every time you edit the file, or you mess with @INC and edit it within the blib/ directory (where it goes when you do the make) and then copy it back into place when you finish. It's even worse if you have multiple modules in your distribution with different namespaces (i.e. Foo::Something and Bar::Something).

    h2xs now puts things in DIST/lib so the old default layout problems you mention are simple to overcome with PERL5LIB and PERL5OPT.

      That looks very helpful. Thanks!