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

hi, all.

i'm trying to make extensive use of "use lib" for this little app i'm doing - i.e. i want to keep all non-core modules in one little nice directory, so that i only have to worry about that directory to be in sync on all machines my app is supposed to run on. all the machines run the same linux distro, so i should theoretically be able to even include XS in that directory....but how do i accomplish this?
i asked on the perlTk list once, and the answer was rather complicated, since some XS gets put in to this directory, and some perl ends up there, and yet something else somewhere else.
so, any hints on how i can keep all those modules in one directory?
thanks,

-schweini
  • Comment on installing modules in a roll-out-friendly way

Replies are listed 'Best First'.
Re: installing modules in a roll-out-friendly way
by Zaxo (Archbishop) on Apr 22, 2004 at 04:54 UTC

    What's wrong with $Config{installsitelib}? ExtUtils::MakeMaker takes that as the default value of INSTALLSITELIB and installs most added modules there. It's already in @INC, so no use lib '/some/path'; is needed.

    Perl and CPAN.pm can keep track of what version of your module is installed on each machine, and update when needed.

    After Compline,
    Zaxo

Re: installing modules in a roll-out-friendly way
by biosysadmin (Deacon) on Apr 22, 2004 at 04:58 UTC
    Depending on your application, you may want to look into PAR. It would allow you to bundle your modules into your program and just migrate the PAR package across multiple machines of the same architecture.

    Here's an article about Perl on use.perl.org, I think it's something that everyone should play with at least once. :D

Re: installing modules in a roll-out-friendly way
by ysth (Canon) on Apr 22, 2004 at 08:58 UTC
    I can't think of anything friendlier than perl -MCPAN -e"install Module::Name", except perhaps to use your linux distro's packaging scheme. Do you really need to fight against using perl's regular locations for site modules?

    Note that my previous stock answer would have been to specify a prefix; but with more and more modules switching from MakeMaker to Module::Build (prematurely, IMO) I don't know how to guarantee that that would work.

      my problem with the excellent CPAN.pm is that it needs an internet-connection, which isn't always an option for those machines of mine.
      what do you mean by "prefix"?