Do you know where your variables are? | |
PerlMonks |
Re: Getting IP from URLby ybiC (Prior) |
on Oct 04, 2002 at 13:12 UTC ( [id://202732]=note: print w/replies, xml ) | Need Help?? |
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")
In Section
Seekers of Perl Wisdom
|
|