Skip Menu |

This queue is for tickets about the NetAddr-IP CPAN distribution.

Report information
The Basics
Id: 67274
Status: resolved
Worked: 2 min
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: mmaslano [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 4.042
Fixed in: (no value)



Subject: Addition of a constant does not work as documented
Documentation of NetAddr::IP states: Addition of a constant ("+") Add a 32 bit signed constant to the address part of a NetAddr object. This operation changes the address part to point so many hosts above the current objects start address. For instance, this code: print NetAddr::IP::Lite->new('127.0.0.1') + 5; will output 127.0.0.6/8. But in reality the output is 127.0.0.1/32. Does something change and documentation should be fixed or it is bug?
On Wed Apr 06 10:13:22 2011, mmaslano@redhat.com wrote: Show quoted text
> Documentation of NetAddr::IP states: Addition of a constant ("+") > Add a 32 bit signed constant to the address part of a NetAddr object. > This operation changes the address part to point so many hosts above > the current objects start address. For instance, this code: > > print NetAddr::IP::Lite->new('127.0.0.1') + 5; > > will output 127.0.0.6/8. > > But in reality the output is 127.0.0.1/32. > > Does something change and documentation should be fixed or it is bug?
This is a documentation issue. New version uploaded with documentation corrected. Should read ->new('127.0.0.1/8') Trying to add a constant to an IP address with a network size of "1" does not get you anywhere. When no netmask is specified the default is a /32