in reply to Simulating the absence of a module

It's evil and bad and I'm sure there are many reasons why you don't want to do this, but you can use a CODEREF in @INC to do something like:

BEGIN { @main::OINC = @INC; unshift @INC, sub { if ( $_[1] eq 'CGI.pm') { @INC = ($_[0]); } else { @INC = ($_[0], @main::OINC); } + return undef; + }; } + use strict; use CGI;

/J\

Replies are listed 'Best First'.
Re^2: Simulating the absence of a module
by Thilosophy (Curate) on Jul 04, 2005 at 13:11 UTC
    That's clever. Thanks++;