I cant seem to figure out the proper usage of the Perl gethostbyaddr function, from what I can tell I have to use Socket, but then I am not sure exactly what the ADDRTYPE parameter is supposed to be
10.10.10.10 is an IP address which does have a reverse dns address on my local network
if I do that I get an error, uninitialised value line 5 which is the print line
if I do either of the following I get nothing being returned
or
I cant seem to get any of them to work, the choice of AF_INET was from search results turned up by Google
Any help much appreciated
10.10.10.10 is an IP address which does have a reverse dns address on my local network
Code:
#!/usr/bin/perl -w
use Socket;
my $ip = "10.10.10.10";
my $addr = gethostbyaddr($ip, AF_INET);
print $addr;
if I do that I get an error, uninitialised value line 5 which is the print line
if I do either of the following I get nothing being returned
Code:
#!/usr/bin/perl -w
use Socket;
my $ip = "10.10.10.10";
my @addr = gethostbyaddr($ip, AF_INET);
foreach (@addr) {
print;
}
Code:
#!/usr/bin/perl -w
use Socket;
my $ip = "10.10.10.10";
my @addr = gethostbyaddr($ip, AF_INET);
print @addr;
I cant seem to get any of them to work, the choice of AF_INET was from search results turned up by Google
Any help much appreciated