Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Keep It Simple, Stupid
 
PerlMonks  

Re: Getting IP with HTTP::Daemon

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://59166]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.