http://qs321.pair.com?node_id=39517

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

I am back building modules. In the past I have always hand built file/package structure, Makefile.pl etc because I have always had trouble getting h2xs -X -n Foo::Bar to do what I want.

So here's what it(h2xs) does:

h2xs -X -n Foo::Bar produces; Foo/Bar/Bar.pm with Bar's package name as 'package Foo::Bar' now if you use Foo::Bar; it of course is not found, you need use Foo::Bar::Bar;

What I want is:

Foo/Bar.pm

Am I missing something or does h2xs just work as it appears and I still need to move stuff around by hand to get what I want.

Thanks.

mitd-Made in the Dark
'My favourite colour appears to be grey.'

Replies are listed 'Best First'.
Re: Module Building and h2xs
by mitd (Curate) on Nov 02, 2000 at 02:53 UTC
    Oh Bollocks!!

    I just figured it out. Project deadlines and new babies are causing grey matter rot.

    On the off chance that I am not alone in my stupidy, here is the answer.

    h2xs -X -n Foo::Bar Foo/Bar/Bar.pm perl Makefile.pl make (make install) puts everything in its right place Foo/Bar.pm

    Makefile.pl knows all does all! sheesh!

    mitd-Made in the Dark
    'My favourite colour appears to be grey.'

Re: Module Building and h2xs
by dchetlin (Friar) on Nov 02, 2000 at 02:30 UTC
    I usually do h2xs -X -n Foo-Bar and then rename `Foo-Bar.pm' to Bar.pm and put it in the right spot. That way when you make a tarball out of the directory, it's not named `Foo.tgz', which only gives you the toplevel name (a real no-no if you're writing, say, HTML::Quux).

    -dlc