Skip Menu |

This queue is for tickets about the Net-CIDR-Lite CPAN distribution.

Report information
The Basics
Id: 50042
Status: resolved
Priority: 0/
Queue: Net-CIDR-Lite

People
Owner: Nobody in particular
Requestors: TOMO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.20
Fixed in: 0.21



Subject: Can't call method "_packer" without a package or object reference..
In the Manual, $spanner->add() method accepts, "... The ’address range’ may be a Net::CIDR::Lite object, a single CIDR address range, a single hyphenated IP address range, or a single IP address." but, it only accepts Net::CIDR::Lite object. Attached diff could fix to do without any croak.
Subject: Lite.diff
--- Net/CIDR/Lite.pm.orig 2006-02-14 09:52:36.000000000 +0900 +++ Net/CIDR/Lite.pm 2009-09-27 18:29:59.000000000 +0900 @@ -315,8 +315,10 @@ my $self = shift; my $ranges = $self->{RANGES}; if (@_ && !$self->{PACK}) { - $self->{PACK} = $_[0]->_packer; - $self->{UNPACK} = $_[0]->_unpacker; + my $cidr = $_[0]; + $cidr = Net::CIDR::Lite->new($cidr) unless ref($cidr); + $self->{PACK} = $cidr->_packer; + $self->{UNPACK} = $cidr->_unpacker; } while (@_) { my ($cidr, $label) = (shift, shift);
Thanks. Fixed in 0.21.