[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: MacPerl-Digest V1 #73



Greetings.

I'm trying to create a chunk of code that will take an IP and return the
appropriate hostname for that IP.
Simple, right?
Not hardly.

This is what I have so far:
-----------------
#!perl -w
use Socket;
use Sys::Hostname;
my($ip, $dns);
#$ip will be available from previous code


print((gethostbyaddr($ip,4)),"\n");
-----------------



I got 4 for ADDRTYPE from the incredibly poorly documented gethostbyname()
function.  The above code does not work at all.  It gives the following
error:

# Use of uninitialized value.

on the line of code "print((gethostbyaddr($ip,4)),"\n"); ".

I'm at my wits end, and the documentation for "use Socket;" sucks royally.

(Chris, Vicki,  you couldn't have at least MENTIONED hostname lookups in
MPPE?  I know what my OWN hostname is, its other people's I'm interested
in.)

Zach



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org