in reply to Re^2: eval "require $module" vs. Module::Load::load($module)
in thread eval "require $module" vs. Module::Load::load($module)
You shouldn't forget that every eval "..." must be followed by or die $@ or you will never find out why requireing your module failed. In that way, I consider my way to be more foolproof. My code is quite different from the code in Module::Load because my code does not try to guess whether it is a filename or a bareword module name and it also does not do any fancy games to massage the error message. I don't like modules that try to be fancy in their error messages because far too often I found that the one helpful error message got suppressed when I wanted to see it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: eval "require $module" vs. Module::Load::load($module)
by djerius (Beadle) on Aug 17, 2007 at 14:59 UTC |