Subject: | Format of $obj->network() |
Date: | Thu, 19 May 2016 16:37:33 +0000 |
To: | "bug-NetAddr-IP [...] rt.cpan.org" <bug-NetAddr-IP [...] rt.cpan.org> |
From: | Stuart Kendrick <stuartk [...] alleninstitute.org> |
BRIEF
I propose that the 'network' method incorrectly returns a non-zero masklen
DOCUMENTATION
Per the documentation:
->network()
Returns a new object referring to the network address of a given subnet. A network address has all zero bits where the bits of the netmask are zero. Normally this is used to refer to a subnet.
TEST SCRIPT
Show quoted text
guru> cat test.plx
#!/opt/local/bin/perl
use strict;
use warnings;
use feature 'say';
use NetAddr::IP;
my $network = '10.1.2.0/24';
my $obj = NetAddr::IP->new($network);
say $obj->network();
Show quoted textguru>./test.plx
10.1.2.0/24
Show quoted textguru>
CHANGE
I propose that this test script produce the following output instead:
10.1.2.0
ENVIRONMENT
Show quoted textguru> /opt/local/bin/perl -v
This is perl 5, version 20, subversion 1 (v5.20.1) built for x86_64-linux-thread-multi
Show quoted textguru> cpan -D NetAddr::IP
CPAN: Storable loaded ok (v2.51)
Reading '/home/netops/.cpan/Metadata'
Database was generated on Thu, 19 May 2016 16:29:02 GMT
NetAddr::IP
-------------------------------------------------------------------------
CPAN: Module::CoreList loaded ok (v5.20160507)
(no description)
M/MI/MIKER/NetAddr-IP-4.079.tar.gz
/opt/local/lib/perl5/site_perl/5.20.1/x86_64-linux-thread-multi/NetAddr/IP.pm
Installed: 4.079
CPAN: 4.079 up to date
Michael Robinton (MIKER)
michael@bizsystems.com
Show quoted textguru> uname -a
Linux guru.company.com 4.4.0-22-generic #40-Ubuntu SMP Thu May 12
22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Show quoted textguru>
--sk