blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:
Under the heading of "I've seen how to do this in my travels by CRS has set in" I remember seeing an algorithm (or may have actually written the thing myself) to take an unsorted list of IP addresses, sort them and then substitute ranges for sequential addresess.
Just so I'm clear as to what I'm after, here's a small sample list:
The expected output would look like:10.0.4.100 10.0.4.99 10.3.5.21 10.0.4.101 10.15.21.6
10.0.4.99-10.0.4.101 10.3.5.21 10.15.21.6
Has anybody done written anything like this or have an idea how to efficiently do this?
Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unsorted IP Addr list to sorted IP list with ranges
by Anonymous Monk on Sep 11, 2003 at 15:46 UTC | |
by LordWeber (Monk) on Sep 11, 2003 at 16:30 UTC | |
Re: Unsorted IP Addr list to sorted IP list with ranges (CPAN module candidates)
by ybiC (Prior) on Sep 11, 2003 at 15:37 UTC | |
Re: Unsorted IP Addr list to sorted IP list with ranges
by jonadab (Parson) on Sep 11, 2003 at 16:19 UTC | |
Re: Unsorted IP Addr list to sorted IP list with ranges
by zengargoyle (Deacon) on Sep 12, 2003 at 07:26 UTC | |
Re: Unsorted IP Addr list to sorted IP list with ranges
by atcroft (Abbot) on Sep 11, 2003 at 23:27 UTC | |
Re: Unsorted IP Addr list to sorted IP list with ranges
by TStanley (Canon) on Sep 12, 2003 at 12:23 UTC |
Back to
Seekers of Perl Wisdom