Commit 8310e13b authored by Syrone Wong's avatar Syrone Wong Committed by Max Lv

add a perl script to generate chnroute (#676)

The perl version takes two seconds while the python version takes more than 30 seconds

Usage: perl ./gen.pl < chnroute.txt > chnroute-merged.txt
Signed-off-by: default avatarSyrone Wong <wong.syrone@gmail.com>
parent 6b91d44c
#!/usr/bin/env 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 "<item>$line</item>\n";
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment