|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
IP operation troubleby fauria (Deacon) |
| on Jan 12, 2005 at 08:34 UTC ( [id://421594]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.fauria has asked for the wisdom of the Perl Monks concerning the following question:
Hi all! Ive got a problem performing IP address operations using Net::IP. Here is what i need: I have to translate an IP address (for example, 10.0.1.3) into an integer value (for example, 167772419), and translate an integer value to an ip (167772419 to 10.0.1.3). I did:
And it prints: Integer value of IP 10.0.1.3: 167772419 Which is correct. But the reverse operation:
Prints: Binary not defined Binary value of integer 167772419: Thus, i dont know how to transform an integer into a binary, and a binary into an ip, which is the only way i currently know. Any idea on how to deal with this? Thank you
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||