From bfd13ef816abf16369321d26f2f63772eff5cd21 Mon Sep 17 00:00:00 2001 From: John D Groenveld Date: Tue, 6 May 1997 13:41:12 -0400 Subject: [PATCH] perlfaq9, hostname Simple patch... p5p-msgid: 199705061741.NAA22777@cse.psu.edu --- pod/perlfaq9.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod index f4f4759..d7faca0 100644 --- a/pod/perlfaq9.pod +++ b/pod/perlfaq9.pod @@ -295,7 +295,7 @@ give you the hostname after which you can find out the IP address use Socket; use Sys::Hostname; my $host = hostname(); - my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost'); + my $addr = inet_ntoa(scalar(gethostbyname($host || 'localhost'))); Probably the simplest way to learn your DNS domain name is to grok it out of /etc/resolv.conf, at least under Unix. Of course, this -- 2.7.4