-
-
Save smls/c51b5d7b328e1fdf8c08 to your computer and use it in GitHub Desktop.
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
sub ip-to-number ($ip) { | |
do given $ip.split('.') { | |
.[0] +< 24 + | |
.[1] +< 16 + | |
.[2] +< 8 + | |
.[3] | |
} | |
} | |
# ips10k.txt = https://github.com/fsufitch/dailyprogrammer/raw/master/ideas/whois/ips10k.txt | |
for "ips10k.txt".IO.lines { | |
my ($start, $end, $name) = .split(' ', 3); | |
say ip-to-number($start), ip-to-number($end); | |
} | |
note now - BEGIN now; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment