From 3b931fb0a67332973fb05e1db5bef262600922d8 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 7 Jul 2020 16:28:22 -0400 Subject: [PATCH 1/2] Add autoconf checks for all used core modules --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index b4c2f77..94c0a7f 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,9 @@ AC_SUBST([PERL]) m4_foreach_w([_m], [ File::Basename File::Path + Getopt::Long + IO::Socket + Sys::Hostname version=0.77 ], [AX_PROG_PERL_MODULES([_m], [], [AC_MSG_ERROR([missing required Perl module _m])])]) From 6ff0362450479eed5cfe3619d6c355b2060272a5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 7 Jul 2020 20:42:40 -0400 Subject: [PATCH 2/2] Get the AF_INET and friends constants from Socket Apparently it is enough to simply import Socket or IO::Socket to use AF_INET and friends, but all examples in official documentation show them in the import list. Because I do not fully understand the intricacies of Perl import logic, I do the same thing here, fully aware that I might have joined a cargo cult. Regardless of its correctness or necessity, listing the constants in the import list has the advantage of making it clear why the `use` statement exists. I chose to import the constants from Socket instead of IO::Socket because that module's documentation explicitly documents the constants. --- configure.ac | 2 +- ddclient.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 94c0a7f..48616e1 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ m4_foreach_w([_m], [ File::Basename File::Path Getopt::Long - IO::Socket + Socket Sys::Hostname version=0.77 ], [AX_PROG_PERL_MODULES([_m], [], diff --git a/ddclient.in b/ddclient.in index 0389ebc..776cb21 100755 --- a/ddclient.in +++ b/ddclient.in @@ -25,8 +25,8 @@ use warnings; use File::Basename; use File::Path qw(make_path); use Getopt::Long; +use Socket qw(AF_INET AF_INET6 PF_INET PF_INET6); use Sys::Hostname; -use IO::Socket; use version 0.77; our $VERSION = version->declare('v3.9.1'); (my $version = $VERSION->stringify()) =~ s/^v//;