Skip to content

Instantly share code, notes, and snippets.

@wongsyrone
Created September 12, 2015 10:02
Show Gist options
  • Save wongsyrone/1d1a04bd92306bd65273 to your computer and use it in GitHub Desktop.
Save wongsyrone/1d1a04bd92306bd65273 to your computer and use it in GitHub Desktop.
merge-cidr.pl
#!/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