Re: ip to decimal ip and back



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



John
--
use Perl;
program
fulfillment
.