in reply to eval "require $module" vs. Module::Load::load($module)

From the Module::Load Documentation:

If you consult perldoc -f require you will see that require will behav +e differently when given a bareword or a string. In the case of a string, require assumes you are wanting to load a fil +e. But in the case of a bareword, it assumes you mean a module. This gives nasty overhead when you are trying to dynamically require m +odules at runtime, since you will need to change the module notation +(Acme::Comment) to a file notation fitting the particular platform yo +u are on.

Actually I have no clue if that's right, but it sounds like it answers your question.

Replies are listed 'Best First'.
Re^2: eval "require $module" vs. Module::Load::load($module)
by Corion (Patriarch) on Aug 17, 2007 at 14:21 UTC

    I think this part is even wrong:

    This gives nasty overhead when you are trying to dynamically require m +odules at runtime, since you will need to change the module notation (Acme::Comment) to a file notation fitting the particular platform you are on.

    ... because require FILENAME always wants unix notation (forward slashes and .pm at the end), no matter what the platform is.

Re^2: eval "require $module" vs. Module::Load::load($module)
by djerius (Beadle) on Aug 17, 2007 at 14:30 UTC
    Thanks, but eval "require $module" avoids this problem as it ensures that require is passed a bareword.