[sf-perl] /usr/local/foo/ for cpan and locally grown modules

David Alban extasia at extasia.org
Wed Jan 24 19:53:20 PST 2007


Greetings,

Assume I'm not allowed to modify the perl installation on a set of
machines.  Assume also that I have write access to the /usr/local/foo
tree.  I can populate it with anything I want.  I wrote a module, say
My::Module.  I put it in /usr/local/foo like so:

  /usr/local/foo/lib/perl/My/Module.pm

So programs that use it can do:

  #!/usr/bin/perl

  [...]

  use lib "/usr/local/foo/lib/perl";
  use My::Module;

Then today I installed Crypt::PasswdMD5 from cpan.  I ran "perl
Makefile.PL".  I then edited the resulting make file so that it would
install in /usr/local/foo rather than the default location.  So now I
have a program that does:

  use lib "/usr/local/foo/lib/perl";
  use My::Module;

  use lib "/usr/local/reg/lib/perl5/site_perl/5.8.0";
  use Crypt::PasswdMD5;

Should I create the directory
/usr/local/reg/lib/perl5/site_perl/5.8.0/My and move the homegrown
Module.pm file there?

Any other suggestions given 1) any modules I install from cpan will go
in the /usr/local/foo tree, and 2) any home grown modules will also go
in that tree, on how stuff should be laid out?

Thanks,
David
-- 
Live in a world of your own, but always welcome visitors.


More information about the SanFrancisco-pm mailing list