bowei_99 has asked for the wisdom of the Perl Monks concerning the following question:
which gives me the following:use strict; use warnings; my $obj_ip = new NetAddr::IP '10.12.100.0','255.255.252.0'; print "Network: " . $obj_ip->network . "\n"; print "Bits: " . $obj_ip->bits . "\n"; print "CIDR: " .$obj_ip->cidr . "\n"; print "Addr: " . $obj_ip->addr . "\n"; print "Mask: " . $obj_ip->mask . "\n";
Why does the Bits show as 32? According the cpan documentation, the default is 32, but it doesn't match with what the CIDR, Network and Mask show. Am I missing something, or is this a bug that I have to get around by parsing $ob_ip->cidr?Network: 10.12.100.0/22 Bits: 32 CIDR: 10.12.100.0/22 Addr: 10.12.100.0 Mask: 255.255.252.0
-- Burvil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bits wrong output in NetAddr::IP ?
by jethro (Monsignor) on Mar 25, 2011 at 15:01 UTC | |
|
Re: Bits wrong output in NetAddr::IP ?
by Anonymous Monk on Mar 25, 2011 at 15:09 UTC |