Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Merge CIDRs

by merlyn (Sage)
on Oct 13, 2001 at 05:24 UTC ( #118616=note: print w/replies, xml ) Need Help??


in reply to Re: Merge CIDRs
in thread Merge CIDRs

1 while s/^(\d*)0\n\1.$/$1/mg || s/^(\d*)\n\1.*$/$1/mg;
There's a reason I put [1] there instead of your ".". Consider what happens when you have the following:
10010 100100 100101
The last two lines will be merged, creating
10010 10010
And your code will strip that final 0 from both lines, creating "1001". Wrong. You must ensure that it's a 1. Can't be "any".

-- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://118616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-12-03 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (56 votes). Check out past polls.

    Notices?