Created
July 19, 2016 06:54
-
-
Save WanpengQian/f34a33b40b97dda1a941dbe6877c2877 to your computer and use it in GitHub Desktop.
IP range to CIDR format
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 -w | |
# range2cidr.pl | |
use Net::CIDR; | |
use Net::CIDR ':all'; | |
if (@ARGV == 0) { | |
die "Usage Example: $0 192.168.0.0-192.168.255.255 \n"; | |
} | |
print join("\n", Net::CIDR::range2cidr("$ARGV[0]")) . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment