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. Advertisements

  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. Advertisements

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

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:
    10
    Views:
    1,578
    Foofy (formerly known as Spaghetti)
    May 14, 2004
  2. Replies:
    0
    Views:
    445
  3. namespace1
    Replies:
    3
    Views:
    1,097
  4. Replies:
    3
    Views:
    642
    Eddie Corns
    Mar 22, 2007
  5. Tigera
    Replies:
    7
    Views:
    487
    Daniel T.
    Jun 4, 2007
  6. Replies:
    0
    Views:
    383
  7. Worky Workerson

    Aggregating/Sorting Large files

    Worky Workerson, May 25, 2006, in forum: Perl Misc
    Replies:
    6
    Views:
    268
    Dr.Ruud
    May 25, 2006
  8. ela
    Replies:
    12
    Views:
    627
    Uri Guttman
    Apr 6, 2009
Loading...