about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1999-09-18 16:26:11 +0000
committerGraham Barr <gbarr@pobox.com>1999-09-18 16:26:11 +0000
commit2cbc4327c3c77bc1366ebb3d90853c3e879bfd75 (patch)
tree43e589b59ab362fb48e26f9ce290ea5cd9d4a5c6
parent030155b28fec83942599d7a9534556b8f0387f23 (diff)
downloadperl-libnet-2cbc4327c3c77bc1366ebb3d90853c3e879bfd75.tar.gz
Net::Domain
- Added support for VMS as suggest by lane@DUPHY4.Physics.Drexel.Edu

-rw-r--r--Net/Domain.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/Net/Domain.pm b/Net/Domain.pm
index bbd9ced..dc42998 100644
--- a/Net/Domain.pm
+++ b/Net/Domain.pm
@@ -16,7 +16,7 @@ use Net::Config;
 @ISA = qw(Exporter);
 @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
 
-$VERSION = "2.12"; # $Id: //depot/libnet/Net/Domain.pm#10 $
+$VERSION = "2.13"; # $Id: //depot/libnet/Net/Domain.pm#11 $
 
 my($host,$domain,$fqdn) = (undef,undef,undef);
 
@@ -46,6 +46,15 @@ sub _hostname {
     elsif ($^O eq 'MacOS') {
         chomp ($host = `hostname`);
     }
+    elsif ($^O eq 'VMS') {   ## multiple varieties of net s/w makes this hard
+        $host = $ENV{'UCX$INET_HOST'} if defined($ENV{'UCX$INET_HOST'});
+        $host = $ENV{'MULTINET_HOST_NAME'} if defined($ENV{'MULTINET_HOST_NAME'});
+        if (index($host,'.') > 0) {
+           $fqdn = $host;
+           ($host,$domain) = $fqdn =~ /^([^\.]+)\.(.*)$/;
+        }
+        return $host;
+    }
     else {
         local $SIG{'__DIE__'};