in reply to Re^2: Integer IP address to Quad IPv4 address one liner or close to it?
in thread Integer IP address to Quad IPv4 address one liner or close to it?
You should probably use the functions in Socket who's names I can never remember, but this works for the dotted decimal form:
print unpack 'N', pack 'C4', split '\.', '127.0.0.1';; 2130706433
It doesn't work for those obscure forms that only hackers and scammers use: dotted-hex & dotted-octal.
|
|---|