http://qs1969.pair.com?node_id=59166


in reply to Getting IP with HTTP::Daemon

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.