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

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

So I'm using h2xs to set up a proper environment for writing modules , a thing I am fairly new at, I might add. I run

h2xs -AXn Client::Graph

and get the directory Client/Graph etc. However, when I modify the file Client/Graph/Graph.pm, I can't use it. What I have to do is move it up a directory. I know that that's how it should work, but is there a way to do that automatically?
_______________________________________________
"Intelligence is a tool used achieve goals, however goals are not always chosen wisely..."

Replies are listed 'Best First'.
Re: h2xs again
by dchetlin (Friar) on Dec 12, 2000 at 02:07 UTC
    Actually, MakeMaker will make it just work. Just cd into Client/Graph, do your perl Makefile.PL, make, make test, and make install, and it will be in the correct directory such that you can `use Client::Graph'.

    If your problem is that you can't use it from the build directory, look at the way the autogenerated test.pl uses it, and copy that. In fact, why not just put the code into the test.pl. You are writing unit tests, right?

    Finally: when you go to package up your distribution, rename the Client directory Client-Graph and then tar it up. That's the style most modules on the CPAN use.

    -dlc

      Finally: when you go to package up your distribution, rename the Client directory Client-Graph and then tar it up. That's the style most modules on the CPAN use.

      No. Don't do that. Do: make dist

      Christian Lemburg
      Brainbench MVP for Perl
      http://www.brainbench.com

Re: h2xs again
by clemburg (Curate) on Dec 12, 2000 at 15:06 UTC

    Read Effective Perl Programming, pages 177 to 195, chapter "Writing Packages and Modules".

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com