Subject: | as_string() bug |
Date: | Fri, 11 Sep 2009 12:39:24 -0500 |
To: | <bug-Net-CIDR-Set [...] rt.cpan.org> |
From: | "Matt Rose" <mcrose [...] excel.net> |
When trying to retrieve the results of a addition of the netblocks
'10.200.3.0/24' and '10.200.4.0/24', I get incorrect netblocks from
as_string(), but as_cidr() works properly. The following code reproduces
the problem, using Net::Cidr::Set 0.11 on perl 5.10.0 and Fedora Core
10:
#!/usr/bin/perl
use Net::CIDR::Set;
use 5.010;
use strict;
use warnings;
use Data::Dumper;
my $netblock_union = Net::CIDR::Set->new;
for my $network (qw (10.200.3.0/24 10.200.4.0/24)) {
$netblock_union->add($network);
}
say "As array:";
print Dumper $netblock_union->as_cidr_array();
say "As string:";
print Dumper $netblock_union->as_string();
And the output is:
As array:
$VAR1 = '10.200.3.0/24';
$VAR2 = '10.200.4.0/24';
As string:
$VAR1 = '10.200.3.0/21';