in reply to Re^3: How to define a package using a tweaked version of LWP::UserAgent?
in thread How to define a package using a tweaked version of LWP::UserAgent?

I'm simply running "make" in the directory where h2xs created the Makefile.

My development sequence so far has been this:

  1. Use h2xs to create the My::Client package skeleton.
  2. Hack away at the skeleton until My::Client does almost everything I want it to.
  3. Discover that I need to override the proxy credentials handling logic in the LWP::UserAgent package.
  4. Look for the leanest/cleanest change which achieves the desired objective (hence this thread).

It sounds like you're saying that it is time for me to reorganize the directory structure of my package distribution.

  • Comment on Re^4: How to define a package using a tweaked version of LWP::UserAgent?

Replies are listed 'Best First'.
Re^5: How to define a package using a tweaked version of LWP::UserAgent?
by moritz (Cardinal) on Jul 31, 2008 at 16:50 UTC
    I'm just trying to describe how most modules organize their directories, and so far it worked out very well for me.

    If you put all your modules in the distribution under lib/, and run your script from directly above lib (aka root for the distribution dir), all you need is a simple use lib 'lib'.

    For installed modules this usually doesn't matter, because make install puts them in a directory below @INC where perl can find it.

      Thanks for the suggestion.

      But it seems that MakeMaker is smarter than I thought, and the simplest solution in my case is to add RequestAgent.pm to lib/My/Client/. Running "perl Makefile.PL" in this directory then creates a Makefile which automatically includes both Client.pm and RequestAgent.pm (and which works with "make test"), and in order to include RequestAgent.pm from inside Client.pm I can simply add this line:

      use My::RequestAgent;
      No hardcoded or relative paths, and no "use lib". Sweet.