@ISA = qw(Exporter);
@EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
-$VERSION = "2.19"; # $Id: //depot/libnet/Net/Domain.pm#21 $
+$VERSION = "2.19_01"; # $Id: //depot/libnet/Net/Domain.pm#21 $
my($host,$domain,$fqdn) = (undef,undef,undef);
=head1 SYNOPSIS
- use Net::Domain qw(hostname hostfqdn hostdomain);
+ use Net::Domain qw(hostname hostfqdn hostdomain domainname);
=head1 DESCRIPTION
Identify and return the FQDN of the current host.
+=item domainname ()
+
+An alias for hostfqdn ().
+
=item hostname ()
Returns the smallest part of the FQDN which can be used to identify the host.
}
}
-use Net::Domain qw(hostname domainname hostdomain);
+use Net::Domain qw(hostname domainname hostdomain hostfqdn);
use Net::Config;
unless($NetConfig{test_hosts}) {
exit 0;
}
-print "1..2\n";
+print "1..5\n";
$domain = domainname();
($domain[0] && $domain[0] eq $copy[0])
? print "ok 2\n"
: print "not ok 2\n";
+
+@dummy = grep { defined hostdomain() and hostdomain() eq $_ } @domain;
+
+($domain[0] && $domain[0] eq $copy[0])
+ ? print "ok 3\n"
+ : print "not ok 3\n";
+
+hostfqdn() eq hostname() . "." . hostdomain() ? print "ok 4\n" : print "not ok 4\n";
+domainname() eq hostname() . "." . hostdomain() ? print "ok 5\n" : print "not ok 5\n";
chomp @Core_Modules;
if (eval { require Socket }) {
- push @Core_Modules, qw(Net::Domain);
# Two Net:: modules need the Convert::EBCDIC if in EBDCIC.
if (ord("A") != 193 || eval { require Convert::EBCDIC }) {
push @Core_Modules, qw(Net::Cmd Net::POP3);