about summary refs log tree commit
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-10-15 20:15:04 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2014-10-15 20:15:04 +0100
commit63feb380c241e6623b08bc5545e423058bad9730 (patch)
treea2575283d1b56895112e02fd0817597f2eeffc2e
parente4f1fd94c4c3654ef423559e9c3227f2a95448a1 (diff)
downloadperl-libnet-63feb380c241e6623b08bc5545e423058bad9730.tar.gz
No need to escape . in a character class
Spotted by "eponymous alias" <eponymousalias@yahoo.com>.
-rw-r--r--lib/Net/Domain.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Net/Domain.pm b/lib/Net/Domain.pm
index ac47ddc..356a3e9 100644
--- a/lib/Net/Domain.pm
+++ b/lib/Net/Domain.pm
@@ -43,7 +43,7 @@ sub _hostname {
     }
     if (defined($host) && index($host, '.') > 0) {
       $fqdn = $host;
-      ($host, $domain) = $fqdn =~ /^([^\.]+)\.(.*)$/;
+      ($host, $domain) = $fqdn =~ /^([^.]+)\.(.*)$/;
     }
     return $host;
   }
@@ -55,7 +55,7 @@ sub _hostname {
     $host = $ENV{'MULTINET_HOST_NAME'} if defined($ENV{'MULTINET_HOST_NAME'});
     if (index($host, '.') > 0) {
       $fqdn = $host;
-      ($host, $domain) = $fqdn =~ /^([^\.]+)\.(.*)$/;
+      ($host, $domain) = $fqdn =~ /^([^.]+)\.(.*)$/;
     }
     return $host;
   }
@@ -98,7 +98,7 @@ sub _hostname {
       }
 
       # Apollo pre-SR10
-      || eval { $host = (split(/[:\. ]/, `/com/host`, 6))[0]; }
+      || eval { $host = (split(/[:. ]/, `/com/host`, 6))[0]; }
 
       || eval { $host = ""; };
   }
@@ -198,7 +198,7 @@ sub _hostdomain {
 
         # Extract domain from FQDN
 
-        ($domain = $site) =~ s/\A[^\.]+\.//;
+        ($domain = $site) =~ s/\A[^.]+\.//;
         return $domain;
       }
     }