3

I have taken the source checkout of two cpan modules : A and B.

Both the modules A and B are developer releases.

B has a dependency on A.

My question is how do I work on B without installing A.

(I already have an older version of A installed)

Egga Hartung
  • 1,061
  • 11
  • 23

2 Answers2

5

If you want to have module A available sometimes, such as when you're working on module B, but not for your regular perl fun, you can look into local::lib, which is a simple way to install some modules to a user-specified directory. Then when you wish to work on module B simply add the directory where module A is installed to your PERL5LIB environment variable, and remove it when you do not need it. See documentation for local::lib: http://search.cpan.org/perldoc?local::lib

bvr
  • 9,687
  • 22
  • 28
Dan
  • 10,531
  • 2
  • 36
  • 55
  • `local::lib` is an overkill. Maybe I can point PERL5LIB to the blilb/lib of A and work on B. –  Jan 06 '12 at 05:44
0

One way to do it is to use lib like this:

perl -Mlib=/some/dir/module/lib program.pl
jmcnamara
  • 38,196
  • 6
  • 90
  • 108
  • `perl -I/some/dir/module/lib program.pl` – Brad Gilbert Jan 06 '12 at 15:40
  • If the `A` library does not work out of the box and has a required build step (e.g. XS modules, code-modifying templates), run the build step first (i.e. `make` or `./Build`) and then use the [`blib`](http://p3rl.org/blib) pragma, thus: `perl -Mblib=/some/dir/A program.pl` - It is safe to use the `blib` pragma even if not strictly required, so I recommend to use it in any case. – daxim Jan 07 '12 at 22:39