Re: ip to decimal ip and back



On 08/17/2006 12:13 AM, uttamhoode@xxxxxxxxx wrote:
hi all,
i need a perl script to

1) convert ip address to decimal eg 127.0.0.1 to 2130706433


Do a CPAN search for /::IP::/

I had to do this before, and it came down to using the right combination of unpack, reverse, map, chr, and split. :-D


and

2)decimal to ip address 2130706433 to 127.0.0.1


I had to do this once, and it came down to using the right combination of join, reverse, map, ord, split and pack.


uttam hoode


Good luck to you.

.



Relevant Pages

  • Re: deep-reverse
    ... second one is okay but it uses map and i don't want that. ... Here is a straightforward reverse using an accumulator: ... (define (reverse-map proc xs) ... (define (aux-reverse-map proc xs r) ...
    (comp.lang.scheme)
  • Re: backwards list question
    ... Joey Fox wrote: ... xs) (reverse (map back xs))] ...
    (comp.lang.scheme)
  • Re: most useful instance methods
    ... The basics were easy enough such as reverse. ... Then came map and ... uniq. ... Im wondering what else is good to practice with. ...
    (comp.lang.ruby)
  • Re: backwards list question
    ... xs) (reverse (map back xs))] ... using map, i assert it never gets incorporated into the solution. ... doesn't return an error message, i'm lead to believe that it was never ...
    (comp.lang.scheme)
  • Re: backwards list question
    ... Joey Fox wrote: ... xs) (reverse (map back xs))] ...
    (comp.lang.scheme)