* Smylers <[EMAIL PROTECTED]> [2007-06-06 13:25]:
> How about instead having use_ok simply removing the %INC entry
> if it's found, so that it can be used safely in exactly this
> situation?
> 
> Would doing that silently obscure any genuine bugs?

It would cause subroutine redefinition warnings and possibly
duplicate resource initialisation and other such badness if the
module really *was* loaded previously. Bad idea.

I think what we really want is to add `use_fails`, which *would*
be able to safely wipe the `%INC` entry after failure, because by
its very meaning, that test function can make an assumption that
is otherwise unsafe.

But both it and `use_ok` should warn if they find the key already
in `%INC`.

Although, as I wrote in comment at Ovid’s, it is `require` in
Perl itself that should really wipe the key whenever a) loading
fails and b) the key was not already there. Who knows if it’s
feasible to change that semantic at this late point, though.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to