This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
5.004m4t1: perlbug: NIS domainname gets into wrong places
authorAndreas J. Koenig <koenig@anna.mind.de>
Fri, 5 Sep 1997 00:00:00 +0000 (00:00 +0000)
committerTim Bunce <Tim.Bunce@ig.co.uk>
Fri, 5 Sep 1997 00:00:00 +0000 (00:00 +0000)
>>>>> Jarkko Hietaniemi writes:

jhi> [patch mode]

jhi> I suggest the following patch: appending the ".`domainname`" only iff
jhi> it contains dots and when last element has only [A-Za-z] and is no
jhi> longer than 3 characters.  What were the latest plans about adding new
jhi> top level domains?  Will these heuristics still be true?

No. And I recall we have been flamed heavily in the past for using
`domainname` at all and I'm surprised that we still do.

I'd suggest such a patch instead:

p5p-msgid: sfcg1qy38as.fsf@anna.in-berlin.de

utils/perlbug.PL

index 6b670fc..0827db8 100644 (file)
@@ -292,12 +292,9 @@ EOF
                        $domain = Mail::Util::maildomain();
                } elsif ($Is_MSWin32) {
                        $domain = $ENV{'USERDOMAIN'};
-               } elsif ($Is_VMS) {
+               } else {
                        require Sys::Hostname;
                        $domain = Sys::Hostname::hostname();
-               } else {
-                       $domain = `hostname`.".".`domainname`;
-                       $domain =~ s/[\r\n]+//g;
                }
            
            my($guess);