http://www.perlmonks.org?node_id=1007748


in reply to Cancel/no-op a require

If making 'use Foo' and 'require Bar' be no-ops is your primary goal, then it is easier to not do that via a hook in @INC (use %INC instead):

BEGIN { $INC{'Foo.pm'} = $INC{'Bar.pm'} = __FILE__ } use Foo; # no-op require Bar; # no-op

- tye