On Fri Oct 03 13:07:02 2008,
http://jonswar.myopenid.com/ wrote:
Show quoted text> If a component does a 'use' or 'require' of a module with an error, no
> error will be reported.
>
> Added test 'require_bad_module_in_once' in 13-errors.t to demonstrate.
There are two problems:
1) Perl will set $INC{Foo.pm} even when 'use Foo' generates an error,
thus allowing subsequent 'use Foo' to pass by without error.
2) In Interp::load, we attempt to recreate and reload an object file
when it has failed, to deal with the possibility of corrupt or empty
object files.
We can solve #2, sort of, by skipping the recreate/reload when the error
matches a certain regex. But I can't think of a way to solve #1, other
than trying to save and restore %INC, which is beyond what I'm willing
to do.
So at most, we can fix this so that the correct error comes up the first
time the file is loaded. (In mod_perl, the first time the file is loaded
in each process).