Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Module Building and h2xs

by mitd (Curate)
on Nov 02, 2000 at 02:08 UTC ( #39517=perlquestion: print w/replies, xml ) Need Help??
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, 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/ 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:


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.


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/ perl make (make install) puts everything in its right place Foo/ 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 `' to 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).


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://39517]
Approved by root
[1nickt]: The best way is to scope it tightly so it just goes away when you are finished with it.
[perldigious]: but... but... perldigious is the unvirtuous kind of lazy in this case. :-)
[perldigious]: Just kidding. Thanks 1nickt, I'll go ahead and do it the right way. An extra set of brackets and a little extra indentation isn't too much to ask.
[karlgoethebier]: perldigious: perhaps a block if you are paranoid ;-)
[choroba]: but undef %hash and %hash = () both work, too, but the first one keeps the memory allocated, while the latter makes it available for other parts of the program.
[choroba]: iirc

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-07-21 19:49 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (335 votes). Check out past polls.