<?xml version="1.0" encoding="windows-1252"?>
<node id="1005042" title="how to force Build test to load all modules from blib/lib first" created="2012-11-21 21:46:53" updated="2012-11-21 21:46:53">
<type id="115">
perlquestion</type>
<author id="1005040">
rbroberts</author>
<data>
<field name="doctext">
I have "family" of modules that I'm having trouble testing. Roughly, the hierarchy looks like

&lt;code&gt;
use A::B::C1;
use A::B::C2;
use A::B::C1::D;
&lt;/code&gt;

"A" is an acronym for our development group, so all of our perl modules start with that. In A::B::C2 and A::B::C1::D there is a line like

&lt;code&gt;
use A::X;
&lt;/code&gt;

What seems to be happening is that A::B and A::B::C2 are loaded from blib/lib, then A::B::C1::D gets loaded from the installed area which is in PERL5LIB. That is also where A::X lives. If I flip the order to the use lines to

&lt;code&gt;
use A::B::C1;
use A::B::C1::D;
use A::B::C2;
&lt;/code&gt;

Then A::B::C1::D is loaded from blib/lib and A::B::C2 is loaded from the installed area. I can't find any way to make sure that all three of the packages in this family get loaded from blib/lib. I've tried playing with @INC with no luck.

How can I convince Perl to use blib/lib first for all of my modules?</field>
</data>
</node>
