# If you rename this file to "$HOME/.cpan/CPAN/MyConfig.pm", then it will cause # the Perl CPAN module to install modules in the directory specified by # $prefix, below, rather than in the Perl install directory, which you may not # desire to modify or may not be allowed to modify. You'll then be able to # use CPAN in the normal way: # perl -MCPAN -e 'install "name-of-module"' # NOTE: Because ExtUtils::MakeMaker only looks in the Perl install directory # for prerequisites, you should expect to get a warning if a module that you're # installing requires versions of modules that don't exist there. So long as # the required versions are installed in your private library (which CPAN # should take care of unless you set 'prerequisites_policy' to 'ignore'), you # may safely ignore this warning, because it's fixed by the setting of # FULLPERL. # To use your private library, you have a few options: # # You can add the following lines near the beginning of the script: # use Config; # use lib "/prefix/path/lib/perl5"; # use lib "/prefix/path/lib/perl5/$Config{archname}"; # # If you don't want to have to modify scripts that use your privately installed # modules, then you can just set your PERL5LIB environment variable thusly: # setenv PERL5LIB /prefix/path/lib/perl5 # It will pick up the arch lib automatically (if it exists). This approach has # the disadvantage that any user who runs the script must have his PERL5LIB # set accordingly. # # Finally, you can specify the library directories with -I switches: # perl -I/prefix/path/lib/perl5/ -I/prefix/path/lib/perl5 myscript use Config; # Where the private perl library lives: my $prefix=qq[$ENV{HOME}/tools]; $CPAN::Config->{'build_dir'} = qq[$ENV{HOME}/.cpan/build]; $CPAN::Config->{'cpan_home'} = qq[$ENV{HOME}/.cpan]; $CPAN::Config->{'keep_source_where'} = qq[$ENV{HOME}/.cpan/sources]; $CPAN::Config->{'makepl_arg'} = join(" ", qq[PREFIX=$prefix], qq[LIB=$prefix/lib/perl5], qq[INSTALLDIRS=perl], qq[INSTALLBIN=$prefix/bin], qq[INSTALLSCRIPT=$prefix/bin], qq[INSTALLMAN1DIR=$prefix/man/man1], qq[INSTALLMAN3DIR=$prefix/man/man3], qq[FULLPERL="$Config{perlpath} -I$prefix/lib/perl5/$Config{archname} -I$prefix/lib/perl5"], ); # Put overrides for stuff that you don't like in the system-wide config here. # To see the system-wide config, try this: # vi `perl -MCPAN::Config -e 'print $INC{"CPAN/Config.pm"}."\n"'` $CPAN::Config->{'prerequisites_policy'} = q[follow]; 1;