From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more
|
#!./perl
BEGIN {
chdir 't' if -d 't' ;
@INC = '../lib' ;
}
BEGIN {
our $hasne ;
eval { my @n = getnetbyname "loopback" };
$hasne = 1 unless $@ && $@ =~ /unimplemented|unsupported/i;
unless ( $hasne ) { print "1..0 # Skip: no getnetbyname\n" ; exit 0 }
$hasne = 0 unless $Config { 'i_netdb' } eq 'define' ;
unless ( $hasne ) { print "1..0 # Skip: no netdb.h\n" ; exit 0 }
}
BEGIN {
our @netent = getnetbyname "loopback" ;
unless ( @netent ) { print "1..0 # Skip: no loopback net\n" ; exit 0 }
}
print "1..2\n" ;
print "ok 1\n" ;
my $netent = getnetbyname "loopback" ;
print "not " unless $netent ->name eq $netent [0];
print "ok 2\n" ;
|