Kevin Old wrote:
> Hello everyone,
> 
> I've written several subroutines that are useful to me, but not useful
> enough to package into separate modules and publish on CPAN.  I put
> them in a module call KOBagOTrix.pm and just use a "use lib"
> statement to point to that module on my hard drive.
> 
> Well, I find that I'm using it more and more these days and am
> wondering if it would make more sense to put it somewhere other than
> my home directory, as I'm using it on several different servers and
> different accounts on those servers.
> 
> So, I ask...where do you put your modules and so that at the top of
> every program I have I don't do "use lib '/home/kdo/perlmods'; use
> KOBagOTrix;".
> 
> Should I just put /home/kdo/perlmods in my @INC on every system?

I would say to generally avoid "use lib" in your scripts and rely on
PERL5LIB instead, as per zentara. Exception would be "use lib" in
conjunction with FindBin to locate script-specific modules relative to your
script itself.

I would also suggest giving your modules a "personal" namespace. For
instance, start all your modules with "KO::".

So you would have stuff like:

   KO::Tricks
   KO::Foo
   KO::Foo::Bar

Then you can install into the sitelib directories without clashing with CPAN
modules.

use h2xs to start your modules.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to