in reply to Bundling Several Modules and their dependents

  1. Finding Dependancies

    You can use CPAN to make an autobundle of all the modules installed in your original ( current) perl build. Or you can try Module::Dependency from CPAN to get a list of file dependancies. You might also look into CPANPLUS as an option if you're able to build on a machine with internet access. CPANPLUS makes it easy to install modules with many dependancies.

  2. Installing modules to custom directories

    You need to specify all of these on the command like when performing a manual build ( perl Makefile.PL PREFIX=...).Most modules only need a few of these but I've found that some will need different ones so I set them all:

    PREFIX=$PREFIX \ INSTALLPRIVLIB=$PREFIX/lib/perl5 \ INSTALLSCRIPT=$PREFIX/bin \ INSTALLSITELIB=$PREFIX/lib/perl5/site_perl \ INSTALLBIN=$PREFIX/bin \ INSTALLMAN1DIR=$PREFIX/lib/perl5/man \ INSTALLMAN3DIR=$PREFIX/lib/perl5/man/man3
    This is documented in perlmodinstall

    I actually keep that snippet in a shell script, like this:

    #!/bin/sh export PREFIX=$HOME/usr/local echo PREFIX=$HOME/usr/local \ INSTALLPRIVLIB=$PREFIX/lib/perl5 \ INSTALLSCRIPT=$PREFIX/bin \ INSTALLSITELIB=$PREFIX/lib/perl5/site_perl \ INSTALLBIN=$PREFIX/bin \ INSTALLMAN1DIR=$PREFIX/lib/perl5/man \ INSTALLMAN3DIR=$PREFIX/lib/perl5/man/man3
    So that $HOME and $PREFIX will be interpreted and then I do: perl Makefile.PL `localperl.sh`

    Or CPANPLUS will let you setup these variables in its configuration if you decide to go that route.

  3. Moving Modules to another machine

    You should be able to just copy the top level directory to another machine provide the architechures and perl builds are identical or if they are all pure perl modules.

  4. Adding to @INC or Custom Library paths

    You can edit an environment variable called PERL5LIB. Directories added here will automatically be added to @INC in all of your scripts.

    It is documented in perlrun

These are techniques that have worked for me, your mileage may vary.

--
Clayton