Canonicalize CIDR: Difference between revisions

(Python alternative)
Line 1,436:
 
=={{header|Raku}}==
===Using library===
{{libheader|raku-IP-Addr}}
<lang perl6>use IP::Addr;
for «87.70.141.1/22 36.18.154.103/12 62.62.197.11/29 67.137.119.181/4 161.214.74.21/24 184.232.176.184/18» -> $cidr {
say "$cidr -> $(IP::Addr.new($cidr).network)";
}</lang>
 
===String manipulation===
{{trans|Perl}}
Line 1,443 ⟶ 1,450:
if !@cidrs {
# test data
@cidrs = «87.70.141.1/22 36.18.154.103/12 62.62.197.11/29 67.137.119.181/4 161.214.74.21/24 184.232.176.184/18»;
}
 
1,480

edits