Skip to content

Commit

Permalink
load report_store modules using Module::Load instead of relying on
Browse files Browse the repository at this point in the history
'eval'
fix #234
  • Loading branch information
bigio committed May 31, 2024
1 parent ac6d3ad commit 3c1ae11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ my %META = (
"IO::Socket::SSL" => 0,
"IO::Uncompress::Gunzip" => 0,
"IO::Uncompress::Unzip" => 0,
"Module::Load" => 0,
"Net::DNS::Resolver" => 0,
"Net::IDN::Encode" => 0,
"Net::IP" => 0,
Expand Down
3 changes: 2 additions & 1 deletion lib/Mail/DMARC/Report/Store.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use strict;
use warnings;

use Carp;
use Module::Load;

use parent 'Mail::DMARC::Base';

Expand Down Expand Up @@ -40,7 +41,7 @@ sub backend {

return $self->{$backend} if ref $self->{$backend};
my $module = "Mail::DMARC::Report::Store::$backend";
eval "use $module"; ## no critic (Eval)
load $module;
if ($@) {
croak "Unable to load backend $backend: $@\n";
}
Expand Down

0 comments on commit 3c1ae11

Please sign in to comment.