in reply to Getting IP from URL

I'm not quite sure what you're wanting to achieve but I think the following piece of code may help - This code takes a URL and attempts to resolve the IP address of the hostname portion of that URL ...

use Socket; use URI; my $url = 'http://www.mydomain.com'; my $uri = URI->new( $url ); my $ip_addr = gethostbyname( $uri->host ); print $url, " -> ", inet_ntoa( $ip_addr ), "\n";

 

perl -e 'print+unpack("N",pack("B32","00000000000000000000000111001000")),"\n"'