in reply to Representing a 32-bit integer
You want unpack, not pack, imo. Although, the document describing pack is a great deal more detailed. Also, see Socket for the inet_aton function, which is of great relevance here.
use Socket; print "", unpack("N", inet_aton("192.168.11.5")), "\n";
UPDATE: This has been amusing me for many minutes now (e.g. unpack("N", inet_aton("google.com"))). Thanks!
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Representing a 32-bit integer
by Thelonius (Priest) on May 22, 2007 at 20:35 UTC |