Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: ip range for config files

by ehdonhon (Curate)
on Nov 05, 2003 at 05:58 UTC ( #304634=note: print w/replies, xml ) Need Help??

in reply to ip range for config files

I tend to prefer Net::Netmask myself. You can achieve similar code to your test code above using Netmask's enumerate() method.

Replies are listed 'Best First'.
Re: Re: ip range for config files
by smackdab (Pilgrim) on Nov 05, 2003 at 06:04 UTC
    Thanks, after looking at Net::Netmask, it doesn't appear that it will accept an IP range: - and have 100 IP address I right? I also don't think NetAddr::IP will also. I think the formats are not compatible...

      The thing about - is that it is impossible to represent that exact range in one net block. You have to use several netblocks of varying sizes to do it. So no, Net::Netmask will not let you do it all in one block because its impossible.

      It does, however, give you the range2cidrlist method that will break that range into a series of valid netblocks for you.

        You know, I'll bet everyone using these modules wants the CIDR format...actually I don't. I want an array of individual IP addresses back from a CIDR format (or a IP-Range format)

        I want to give the user an option to specify a range of IP addresses in their favorite format and then get the array back...

        I am very likely very CONFUSED...

        Say I have a config file of hosts/devices to ping...

        # Ping me list
        host1;;; host2

        I am looking for a proper format to allow. right now, you have to list 1 IP or hostname on EACH line ;-(

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://304634]
[holli]: You see, I have a friend whose daughter has been damaged seriously because she wasn't vaccinated against measles. (Her mother being anti-vaxx).
[LanX]: Contrary to Olivia newton John I don't like physical confrontations ...
[LanX]: Oh, you spread measles in your saliva?
[LanX]: ... and why did you bite hos daughter?
[LanX]: *his
[holli]: And this guy was also Anti-Vaxx and I just snapped. I shoed him all over the yard
[james28909]: biting between the legs? now thats my kind of religion.
[holli]: and back into the building, saw him later peeking out of the window looking scared. It was hilarious.
[LanX]: Let's get physical...
[james28909]: wish i could stay and chat. i have an unsuspecting client to give an estimate to. muhhahaha

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2017-12-13 18:04 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (373 votes). Check out past polls.