local::lib

Create and use a local lib/ for Perl modules with PERL5LIB
Download

local::lib Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matt S Trout
  • Publisher web site:
  • http://search.cpan.org/~mstrout/

local::lib Tags


local::lib Description

Create and use a local lib/ for Perl modules with PERL5LIB local::lib is a Perl module that provides a quick, convenient way of bootstrapping a user-local Perl module library located within the user's home directory. It also constructs and prints out for the user the list of environment variables using the syntax appropriate for the user's current shell (as specified by the SHELL environment variable), suitable for directly adding to one's shell configuration file.More generally, local::lib allows for the bootstrapping and usage of a directory containing Perl modules outside of Perl's @INC. This makes it easier to ship an application with an app-specific copy of a Perl module, or collection of modules. Useful in cases like when an upstream maintainer hasn't applied a patch to a module of theirs that you need for your application.On import, local::lib sets the following environment variables to appropriate values:MODULEBUILDRCPERL_MM_OPTPERL5LIBPATH PATH is appended to, rather than clobbered.These values are then available for reference by any code after import.SYNOPSISIn code - use local::lib; # sets up a local lib at ~/perl5 use local::lib '~/foo'; # same, but ~/foo # Or... use FindBin; use local::lib "$FindBin::Bin/../support"; # app-local support libraryFrom the shell - # Install LWP and its missing dependencies to the '~/perl5' directory perl -MCPAN -Mlocal::lib -e 'CPAN::install(LWP)' # Just print out useful shell commands $ perl -Mlocal::lib export MODULEBUILDRC=/home/username/perl/.modulebuildrc export PERL_MM_OPT='INSTALL_BASE=/home/username/perl' export PERL5LIB='/home/username/perl/lib/perl5:/home/username/perl/lib/perl5/i386-linux' export PATH="/home/username/perl/bin:$PATH" Requirements: · Perl


local::lib Related Software