From owner-freebsd-questions Fri Feb 5 12:41:39 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA27514 for freebsd-questions-outgoing; Fri, 5 Feb 1999 12:41:39 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from java.dpcsys.com (java.dpcsys.com [206.16.184.7]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA27495 for ; Fri, 5 Feb 1999 12:41:33 -0800 (PST) (envelope-from dan@dpcsys.com) Received: from localhost (dan@localhost) by java.dpcsys.com (8.9.1a/8.9.1) with SMTP id LAA04548; Fri, 5 Feb 1999 11:46:56 -0800 (PST) Date: Fri, 5 Feb 1999 11:46:56 -0800 (PST) From: Dan Busarow To: "Randy A. Katz" cc: questions@FreeBSD.ORG Subject: Re: A Perl Question In-Reply-To: <3.0.5.32.19990205001838.03baa980@ccsales.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 5 Feb 1999, Randy A. Katz wrote: > I'm trying to use gethostbyaddr and it is returning blank: > > $ipaddress = "216.0.22.30"; > ($name, $aliases, $addrtype, $length, @addrs) = > gethostbyaddr($ipaddress,AF_INET); > print "Name: $name\n"; Two things. If you are hardcoding the IP address use $ipaddress = inet_aton("216.0.22.30"); gethostbyaddr expects $ipaddress to be a four byte "struct". Second, perldoc Socket says that gethostbyaddr just returns a scalar name, not a list. Dan -- Dan Busarow 949 443 4172 Dana Point Communications, Inc. dan@dpcsys.com Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message