Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

try it without 192.168.0.1/8, it's invalid and a /8 is huge (2**24).

which is your second problem, in your for loop your forcing all of the individual IPs to be created at once which takes tons of memory and time. you want to read the documentation and use the iterator.

i'm too lazy to look it up at the moment, but it'll be something like:

while ( my $ip = $n->next ) { # do something with ip }

this will only create one IP at a time and be much much faster and use much less memory.

192.168.0.1/8 is invalid. 192.0.0.0/8 would be valid. unless your trying to specify a host and a network at the same time (as on a network interface).

all in all i wouldn't worry about using 192.168.0.1-12 format. i've never seen a need in many years of keeping lists of IPs. most people who have to do whatever with a lot of IPs that can't be constrained into CIDR notation will already have a list with each IP for use with other programs that take IP addresses.


In reply to Re: ip range for config files by zengargoyle
in thread ip range for config files by smackdab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found