From bb658d763ac7aa6e78b7305c42291dfc06878afe Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 3 Jun 2024 22:09:23 -0400 Subject: [PATCH] Simplify loading of `JSON::PP` --- ddclient.in | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ddclient.in b/ddclient.in index b758420..9af3867 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2612,13 +2612,9 @@ EOM ## load_json_support ###################################################################### sub load_json_support { - my $why = shift; - my $json_loaded = eval { require JSON::PP }; - unless ($json_loaded) { - fatal("%s", <<"EOM"); -Error loading the Perl module JSON::PP needed for $why update. -EOM - } + my ($protocol) = @_; + eval { require JSON::PP; } + or fatal("Error loading the Perl module JSON::PP needed for $protocol update."); JSON::PP->import(qw/decode_json encode_json/); }