Simplify loading of JSON::PP
This commit is contained in:
parent
1401ff4aea
commit
bb658d763a
1 changed files with 3 additions and 7 deletions
10
ddclient.in
10
ddclient.in
|
@ -2612,13 +2612,9 @@ EOM
|
||||||
## load_json_support
|
## load_json_support
|
||||||
######################################################################
|
######################################################################
|
||||||
sub load_json_support {
|
sub load_json_support {
|
||||||
my $why = shift;
|
my ($protocol) = @_;
|
||||||
my $json_loaded = eval { require JSON::PP };
|
eval { require JSON::PP; }
|
||||||
unless ($json_loaded) {
|
or fatal("Error loading the Perl module JSON::PP needed for $protocol update.");
|
||||||
fatal("%s", <<"EOM");
|
|
||||||
Error loading the Perl module JSON::PP needed for $why update.
|
|
||||||
EOM
|
|
||||||
}
|
|
||||||
JSON::PP->import(qw/decode_json encode_json/);
|
JSON::PP->import(qw/decode_json encode_json/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue