Created
September 12, 2015 10:02
-
-
Save wongsyrone/1d1a04bd92306bd65273 to your computer and use it in GitHub Desktop.
merge-cidr.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
## ArchLinux install package via pacman: perl-net-cidr-lite | |
use strict; | |
use warnings; | |
use Net::CIDR::Lite; | |
my $cidr = Net::CIDR::Lite->new; | |
while (my $line=<>) { | |
$cidr->add($line); | |
} | |
foreach my $line( @{$cidr->list} ) { | |
print "$line\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment