Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Getting IP with HTTP::Daemon

by IndyZ (Friar)
on Feb 18, 2001 at 01:47 UTC ( [id://59166]=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://59166]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-05-24 20:45 GMT
Find Nodes?
    Voting Booth?

    No recent polls found