in reply to how to update @INC at runtime to use custom modules in other folder?

with respect to the struture you listed, where is the test script being run from?
Just a
use lib qw( tools/DBQuery );
might do the trick. Note that 'use lib' takes a path, not a namespace as an argument ...
  • Comment on Re: how to update @INC at runtime to use custom modules in other folder?
  • Download Code

Replies are listed 'Best First'.
Re^2: how to update @INC at runtime to use custom modules in other folder?
by bart (Canon) on Mar 26, 2006 at 14:35 UTC
    And ditto with tools/ToolLog.

    The OP could use a rel2abs call in case he changes his directory later:

    use File::Spec::Functions qw(rel2abs); use lib rel2abs(tools/DBQuery), rel2abs(tools/ToolLog);

    Still, I'm wonderin, with such an elaborate directory structure, why the module name/namespace hasn't been extended to include the extra top level?

    use File::Spec::Functions qw(rel2abs); use lib rel2abs('tools'); use DBQuery::Data::BackendMap; use ToolLog::Logging;