Re: ip to decimal ip and back
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Aug 2006 11:56:06 GMT
uttamhoode@xxxxxxxxx wrote in news:1155806520.935160.62520
@i42g2000cwa.googlegroups.com:
[ Please do not top-pots. Please do not quote sigs. ]
John W. Krahn wrote:....
uttamhoode@xxxxxxxxx wrote:
hi all,
i need a perl script to
1) convert ip address to decimal eg 127.0.0.1 to 2130706433
$ perl -MSocket -le'print unpack q/N/, inet_aton q/127.0.0.1/'
2130706433
and
2)decimal to ip address 2130706433 to 127.0.0.1
$ perl -MSocket -le'print inet_ntoa pack q/N/, 2130706433'
127.0.0.1
Thanks John,
i would prefer Socket module to convert the ip address.
Your statement above is confusing. John Krahn's code *is* using the
Socket module.
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.
- References:
- ip to decimal ip and back
- From: uttamhoode
- Re: ip to decimal ip and back
- From: John W. Krahn
- Re: ip to decimal ip and back
- From: uttamhoode
- ip to decimal ip and back
- Prev by Date: Re: Makefile.PL requires parameters for Sendmail::Milter
- Next by Date: Question on File::Find
- Previous by thread: Re: ip to decimal ip and back
- Next by thread: Re: ip to decimal ip and back
- Index(es):