This is a FAQ. Look here. | [reply] |
First, write or regex to get the hostname, by itself, out of
$d->url. I will leave this as a skill building excercise for
you. Then, try this:
use Socket;
@addresses = gethostbyname($name) or die "Can't resolve $name: $!\n";
@addresses = map { inet_ntoa($_) } @addresses[4 .. $#addresses];
@addresses will contain a list of IP addresses. I think that
this code is verbatim from the Perl Cookbook, I just copied and
pasted it out of an old project of mine. | [reply] [d/l] |
Hi.
I've tried using the first example and the one's in the FAQ, but they won't work. Many are only for linux, and I'm running it on windows 95.
The one with the gethostbyname(hostname) just returns a bunch of unreadable symbols.
Isn't there another way of getting the IP address of the computer?
Ralph :) | [reply] |