Michael Graham wrote:
Ivan Tubert-Brohman <[EMAIL PROTECTED]> wrote:


Randy W. Sims wrote:

Is there a way to make C<require> or C<use> fail without manipulating
@INC or hiding the physical file?

Check out Devel::Hide. I've never used it, but it's supposed to do that.


Another strategy is to take advantage of the fact that require fails if
a module doesn't end with a true value.  Zero-length files work fine for
this purpose.

In a private lib directory create zero-length files for all the modules
you want to fail.

D'oh. I shoulda taut a dat. I tried defining sub Module::import {die} which works for C<use>, but not C<require>. I thought of pushing coderef on @INC, but it don't work for older perls. Ivan's suggestion of Devel::Hide, while doing exactly what I want, unfortunately requires perl > 5.8.

This should work perfectly.

Thanks,
Randy.


Reply via email to