in reply to Conditionally faking a module

# add Cava\Pack.pm at the end of include path, # real Cava::Pack is found earlier push @INC, './dummy' use Cava::Pack

Replies are listed 'Best First'.
Re^2: Conditionally faking a module
by Anonymous Monk on Jan 15, 2010 at 09:16 UTC
    use happens at BEGIN time, so to make your strategy work you would need
    BEGIN { push @INC, './dummy'; }
    Its shorter to use lib
    use lib './dummy';
      You are right with the BEGIN block, but 'use lib' adds to the high priority end of @INC, so the real package is never found.