in reply to Re^2: Detecting broken modules
in thread Detecting broken modules

What version of Perl are you using? I get the same results as you on an old box with 5.8.4 installed, but on my main box with 5.10.0, I get different results: $INC{module.pm} is undef if require module dies, and calling require module a second time fails.

In both versions, I can trick the require into trying again, and producing the original error message for me, simply by wrapping my own call in a little localisation:

{ local %INC = %INC; delete $INC{$sFile}; $result = eval "require Monk::Foo::Bar"; $error = $@; }

Though, on reflection, that has obvious issues for modules that really don't want to be loaded more than once, so maybe it's not a good idea.