in reply to Re^4: 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 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.

Replies are listed 'Best First'.
Re^6: How to define a package using a tweaked version of LWP::UserAgent?
by pwolfenden (Novice) on Jul 31, 2008 at 17:27 UTC

    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.