Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Detecting broken modules

by Porculus (Hermit)
on Jun 30, 2009 at 22:32 UTC ( [id://776200]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://776200]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found