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

That method ignores that fact that perl search for .pmc files first, only then for .pm files.

Most of the time there are no .pmc files, but iirc v6 uses them.

  • Comment on Re^2: eval "require $module" vs. Module::Load::load($module)

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

    Did you test your claim?

    corion@aliens:~/parent$ perl -we 'require "t/lib/FileThatOnlyExistsAsP +MC.pm"' corion@aliens:~/parent$ perl -we 'require "t/lib/FileThatOnlyExistsAsP +MC.pm" or die "Uhoh"' corion@aliens:~/parent$ ls -l t/lib/FileThatOnlyExistsAsPMC.pmc -rwxr-xr-x 2 corion corion 82 2007-08-02 22:57 t/lib/FileThatOnlyExist +sAsPMC.pmc corion@aliens:~/parent$ cat t/lib/FileThatOnlyExistsAsPMC.pmc package FileThatOnlyExistsAsPMC; sub exclaim { "I CAN FROM " . __PACKAGE__ } 1;
Re^3: eval "require $module" vs. Module::Load::load($module)
by djerius (Beadle) on Aug 17, 2007 at 16:12 UTC
    Modern versions of perl will search for .pmc files if you require 'file.pm'. The change ocurred sometime between 5.00501 (which doesn't), and 5.6.0 (which does).