| 1 | 1 | ▶ | use NetAddr::IP::Lite; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | 1 | my @masks = 0 .. 32; | |||||||||
| 4 | |||||||||||
| 5 | 1 | $| = 1; | |||||||||
| 6 | |||||||||||
| 7 | 1 | print '1..', scalar @masks, "\n"; | |||||||||
| 8 | |||||||||||
| 9 | 1 | my $count = 1; | |||||||||
| 10 | |||||||||||
| 11 | 1 | for my $m (@masks) { | |||||||||
| 12 | 33 | my $ip = new NetAddr::IP::Lite '10.0.0.1', $m; | |||||||||
| 13 | 33 | ▶ | if ($ip->masklen == $m) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 33 | print "ok ", $count ++, "\n"; | |||||||||
| 15 | } | ||||||||||
| 16 | else { | ||||||||||
| 17 | 0 | print "not ok ", $count ++, "\n"; | |||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||