Re: ip to decimal ip and back



Thanks John,
i would prefer Socket module to convert the ip address.
Regards,
uttam hoode





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



John
--
use Perl;
program
fulfillment

.



Relevant Pages

  • Re: DBI - DB2 Perl Script ... TWiki
    ... John W. Krahn wrote: ... the following lines within the Perl script and it does not work too ... ... Inside your Perl program do this: ...
    (perl.beginners)
  • Re: Modifying Array inside While statement
    ... John W. Krahn wrote: ... >> Andy wrote: ... >>>I have a perl script that takes an array and processes the arguments ...
    (comp.lang.perl.misc)
  • Re: how do I clear screen
    ... John ???????: ... I have the following in a Perl script. ... moveTo; ... but are almost completaly useless;) ...
    (comp.lang.javascript)
  • Re: permissions denied
    ... >Hi John, ... >Do you use anonymous access? ... If yes you will have to grant ... >> My perl script can't write to a file. ...
    (microsoft.public.inetserver.iis.security)
  • Re: write to stdout and another file at the same time.
    ... To the screen 2) A file that acts as our log file. ... Please keep in mind that I need to do this from inside the perl script. ... it had something to do with |tee. ... John ...
    (comp.lang.perl.misc)