Switched dynamic module loading to use Module::Load
Dynamic loading was being done using require, but because of require's rather idosyncratic behaviour it would fail if modules had :: in their names (needs to be converted to / to avoid issues). Module::Load handles all the shenanigans nicely...
This commit is contained in:
parent
7b0115c5cb
commit
ac474f6ad2
@ -25,6 +25,7 @@
|
||||
package AuthMethods;
|
||||
|
||||
use strict;
|
||||
use Module::Load;
|
||||
|
||||
our $errstr;
|
||||
|
||||
@ -139,7 +140,7 @@ sub load_method {
|
||||
my $name = $module -> {"perl_module"};
|
||||
|
||||
no strict "refs"; # must disable strict references to allow named module loading.
|
||||
eval "require $name";
|
||||
eval { load $name };
|
||||
die "Unable to load auth module $name: $@" if($@);
|
||||
|
||||
my $methodobj = $name -> new(%settings);
|
||||
|
@ -24,6 +24,7 @@ package Modules;
|
||||
|
||||
#use lib qw(/home/webperl); # modules needed for utils, blocks needed for plugins
|
||||
use DBI;
|
||||
use Module::Load;
|
||||
use Logging qw(die_log);
|
||||
use strict;
|
||||
|
||||
@ -219,7 +220,7 @@ sub _new_module_internal {
|
||||
|
||||
my $name = $modrow -> {"perl_module"};
|
||||
no strict "refs"; # must disable strict references to allow named module loading.
|
||||
eval "require $name";
|
||||
eval { load $name };
|
||||
die "Unable to load module $name: $@" if($@);
|
||||
|
||||
# Set up the module argument hash...
|
||||
|
Loading…
x
Reference in New Issue
Block a user