# thanks to jdporter and ikegami who have shown me a much better way t +o do this! # # Thanks to ikegami for the code example use Socket qw( inet_aton inet_ntoa ); sub DottedQuadToLong { # Accepts triton.littlefish.ca # Accepts 24.72.30.83 # Accepts 407379539 # etc return unpack('N', inet_aton(shift)); } sub LongToDottedQuad { return inet_ntoa(pack('N', shift)); }
In reply to IP address - long to dottedquad to long by ruzam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |