Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Is there a module which has a class which stores Ip Addesses? Some thing which would be initialized via a string. Also, throw exceptions when the Ip address is incorrectly formatted.

Thanks!

Replies are listed 'Best First'.
Re: Ip Address Type
by poolpi (Hermit) on Mar 16, 2009 at 15:53 UTC

    Also, throw exceptions when the Ip address is incorrectly formatted.

    Regular expressions to validate IPV4, see Regexp::Common::net


    hth,
    PooLpi

    'Ebry haffa hoe hab im tik a bush'. Jamaican proverb
Re: Ip Address Type
by ELISHEVA (Prior) on Mar 16, 2009 at 15:48 UTC
    Search http://search.cpan.org/search using the words IPV6 or IPV4. There are many, many modules. If you need a more specific answer, you might add some details about what you need to do with IP addresses and ports.

    Best, beth

Re: Ip Address Type
by Anonymous Monk on Mar 16, 2009 at 15:28 UTC
    And if it stores a port number also, that would be great!!!
      Sorry about my bad english, perhaps I'm not being clear. I wan't a class which stores a single Ip Address and Port.