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.
This commit is contained in:
parent
3b931fb0a6
commit
6ff0362450
2 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ m4_foreach_w([_m], [
|
||||||
File::Basename
|
File::Basename
|
||||||
File::Path
|
File::Path
|
||||||
Getopt::Long
|
Getopt::Long
|
||||||
IO::Socket
|
Socket
|
||||||
Sys::Hostname
|
Sys::Hostname
|
||||||
version=0.77
|
version=0.77
|
||||||
], [AX_PROG_PERL_MODULES([_m], [],
|
], [AX_PROG_PERL_MODULES([_m], [],
|
||||||
|
|
|
@ -25,8 +25,8 @@ use warnings;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::Path qw(make_path);
|
use File::Path qw(make_path);
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
use Socket qw(AF_INET AF_INET6 PF_INET PF_INET6);
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
use IO::Socket;
|
|
||||||
|
|
||||||
use version 0.77; our $VERSION = version->declare('v3.9.1');
|
use version 0.77; our $VERSION = version->declare('v3.9.1');
|
||||||
(my $version = $VERSION->stringify()) =~ s/^v//;
|
(my $version = $VERSION->stringify()) =~ s/^v//;
|
||||||
|
|
Loading…
Reference in a new issue