aggregating single IP addresses into CIDRs?

Discussion in 'Perl Misc' started by Gerald Jones, May 18, 2004.

  1. Gerald Jones

    Gerald Jones Guest

    Is there a perl way to take a list of IP unordered addresses in dotted quad
    format and group them into more compact CIDR format?

    TIA,
    Gerald.
     
    Gerald Jones, May 18, 2004
    #1
    1. Advertising

  2. Gerald Jones wrote:
    > Is there a perl way to take a list of IP unordered addresses in dotted quad
    > format and group them into more compact CIDR format?


    How about:
    Convert to integer (doable if IPv4)
    Or into one integer
    Find the least significant "1".
    Done

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, May 19, 2004
    #2
    1. Advertising

  3. John W. Krahn, May 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    377
  2. Replies:
    3
    Views:
    466
    Eddie Corns
    Mar 22, 2007
  3. Tigera
    Replies:
    7
    Views:
    318
    Daniel T.
    Jun 4, 2007
  4. Replies:
    0
    Views:
    302
  5. Worky Workerson

    Aggregating/Sorting Large files

    Worky Workerson, May 25, 2006, in forum: Perl Misc
    Replies:
    6
    Views:
    178
    Dr.Ruud
    May 25, 2006
Loading...

Share This Page