in reply to Re: IP to numeric value.
in thread IP to numeric value.

Ah, thank you.

I'm still rather new to perl, so I guess I inadvertently spend a little time reinventing the wheel.

Though, I suppose it's always a good exercise to figure out how those sort of functions work on your own.

- cerror

Replies are listed 'Best First'.
Re^3: IP to numeric value.
by Mutant (Priest) on Jul 12, 2007 at 10:32 UTC
    There's nothing wrong with reinventing the wheel, so long as you're know you're doing it, and are clear on the reasons why you're doing it. To learn how something works is a pretty good reason.
Re^3: IP to numeric value.
by rhesa (Vicar) on Jul 12, 2007 at 18:46 UTC
    Absolutely, what Mutant said. It's always good to practice. Bit-manipulation functions are low-level enough that it takes some time to get them committed to memory.

    As for reinventing the wheel, you don't always realise you're doing it until someone else points out the existing ones.

    As a matter of fact, I just discovered an ip2num function in one of my own libraries (written about 3 years ago). I guess I didn't know about those native functions back then either :-)