Skip to content

Instantly share code, notes, and snippets.

@dynax60
Created October 22, 2010 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dynax60/640480 to your computer and use it in GitHub Desktop.
Save dynax60/640480 to your computer and use it in GitHub Desktop.
Паковка и распаковка IP-адреса
$ perl -MSocket -le 'print unpack("N", inet_aton(shift))' 127.0.0.1
2130706433
$ perl -MSocket -le 'print inet_ntoa(pack("N", shift))' 2130706433
127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment