Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Getting IP from URL

by ybiC (Prior)
on Oct 04, 2002 at 13:12 UTC ( [id://202732]=note: print w/replies, xml ) Need Help??


in reply to Getting IP from URL

I may misunderstand your question, but...

Given a textual URL (protocol://host.dom/dir/file), the first thing you'll need to do is extract the "host.dom" part from the entire URL.   A CPAN search on "url" turns up some hits on modules that may (or may not) help.   Next you'd need to resolve the host names to IP addresses using DNS.   A quick look through Networking Code in Code Catacombs finds (code) Resolve list of DNS names by yours truly that should do nicely.

But if you want to match URL entries containing IP addresses instead of 'host.dom', then check out Regexp::Common::net by our very own Abigail-II.
    cheers,
    Don
    striving toward Perl Adept
    (it's pronounced "why-bick")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-18 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found