Upgrade to Locale::Maketext 1.07.
[p5sagit/p5-mst-13.2.git] / lib / Net / Domain.pm
index b79ec8f..40ad2a8 100644 (file)
@@ -16,7 +16,7 @@ use Net::Config;
 @ISA = qw(Exporter);
 @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
 
-$VERSION = "2.17"; # $Id: //depot/libnet/Net/Domain.pm#19 $
+$VERSION = "2.19"; # $Id: //depot/libnet/Net/Domain.pm#21 $
 
 my($host,$domain,$fqdn) = (undef,undef,undef);
 
@@ -164,14 +164,20 @@ sub _hostdomain {
                    : undef;
         };
 
+       if ( $^O eq 'VMS' ) {
+           $dom ||= $ENV{'TCPIP$INET_DOMAIN'}
+                || $ENV{'UCX$INET_DOMAIN'};
+       }
+
        chop($dom = `domainname 2>/dev/null`)
                unless(defined $dom || $^O =~ /^(?:cygwin|MSWin32)/);
 
        if(defined $dom) {
            my @h = ();
+           $dom =~ s/^\.+//;
            while(length($dom)) {
                push(@h, "$host.$dom");
-               $dom =~ s/^[^.]+.//;
+               $dom =~ s/^[^.]+.+// or last;
            }
            unshift(@hosts,@h);
        }
@@ -331,6 +337,6 @@ it under the same terms as Perl itself.
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/Domain.pm#19 $>
+I<$Id: //depot/libnet/Net/Domain.pm#21 $>
 
 =cut