On Nov 23, 2011, at 4:24 AM, Arvind wrote:

> To do this I want to convert an IP address of the form A.B.C.D into a
> number that will serve as an index of the array. 

Well, IP4 addresses can simply be represented as a decimal.

So, 127.0.0.1 is 2130706433.

Example on how to calculate it:

http://www.allredroster.com/iptodec.htm

IP6 addresses are a different kettle of fish:

A Compact Representation of IPv6 Addresses
http://tools.ietf.org/html/rfc1924

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to