Skip Menu |

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

Report information
The Basics
Id: 111222
Status: resolved
Priority: 0/
Queue: Net-CIDR-Lookup

People
Owner: MBETHKE [...] cpan.org
Requestors: baldwin [...] panix.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.54



Subject: Documentation error for Net-CIDR-Lookup
Date: Fri, 15 Jan 2016 14:52:28 -0500
To: bug-Net-CIDR-Lookup [...] rt.cpan.org
From: "J.D. Baldwin" <baldwin [...] panix.com>
Hello, I have noticed a small error in the documentation for Net-CIDR-Lookup. This caused me a small amount of confusion until I realized the error. Here is some of the example code under the SYNOPSIS section: 1 use Net::CIDR::Lookup; 2 3 $cidr = Net::CIDR::Lookup->new; 4 $cidr->add("192.168.42.0/24",1); # Add first network, value 1 5 $cidr->add_num(167772448,27,2); # 10.0.1.32/27 => 2 6 $cidr->add("192.168.43.0/24",1); # Automatic coalescing to a /23 7 $cidr->add("192.168.41.0/24",2); # Stays separate due to different value 8 $cidr->add("192.168.42.128/25",2); # Error: overlaps with different value 9 10 $val = $h->lookup("192.168.41.123"); # => 2 11 12 $h = $cidr->to_hash; # Convert tree to a hash The $h variable in line 10 is out of place. It has not been previously defined. In line 12, it is defined as the result of a conversion to hash -- but obviously a hash is not a Net-CIDR-Lookup object. Changing line 10 to $val = $cidr->lookup("192.168.41.123"); # => 2 conveys the actual meaning and fixes the confusing error. I hope this is helpful to you and others. jd
Hi JD, sorry or the late reply - you're absolutely right, I probably rearranged something in the doc earlier and got the lines mixed up. There was another bug(let) worth fixing so the change is out with V0.54 already.