diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-10-09 23:01:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 23:01:07 +0200 |
commit | 75dbfe1dc03748957f07eca5ac583bedc6fdba76 (patch) | |
tree | 692f90aa15f4e512581cf2cf06a9b240757aaaba /Bugzilla/DB.pm | |
parent | 2ae37c378b50b1ae16c35ce74999b19eb91af07d (diff) | |
download | bugzilla-75dbfe1dc03748957f07eca5ac583bedc6fdba76.tar.gz bugzilla-75dbfe1dc03748957f07eca5ac583bedc6fdba76.tar.xz |
Bug 623384 - Use Module::Runtime instead of eval { require } or eval "use"
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r-- | Bugzilla/DB.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 142c241bf..87110aaaa 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -34,6 +34,7 @@ use List::Util qw(max); use Scalar::Util qw(weaken); use Storable qw(dclone); use English qw(-no_match_vars); +use Module::Runtime qw(require_module); has [qw(dsn user pass attrs)] => ( is => 'ro', @@ -174,7 +175,7 @@ sub _connect { my $pkg_module = DB_MODULE->{lc($driver)}->{db}; # do the actual import - eval ("require $pkg_module") + eval { require_module($pkg_module) } || die ("'$driver' is not a valid choice for \$db_driver in " . " localconfig: " . $@); |