Skip Menu |

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

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

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

Bug Information
Severity: (no value)
Broken in: 4.075
Fixed in: 4.061



Subject: Inconsistency in object creation
Not sure if this is a bug, or only a documentation issue, but I noticed a slight inconsistency of behaviour when creating a NetAddr::IP object with an empty string and/or undef address. # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP->new(undef,"255.255.255.0")' 4.075 0.0.0.0/24 # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP->new("","255.255.255.0")' 4.075 On an older version (4.027) supplying undef, or empty string makes no difference, and always returns undef # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP->new(undef,"255.255.255.0")' 4.027 # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP->new("","255.255.255.0")' 4.027 I guess that this issue is related to #75976
prior to 4.050, and empty string returned "undef" The change in behavior was introduced in 4.050 version and reverted back to original behavior in 4.060 Please see the Changes file. On Mon May 11 08:15:00 2015, MAROS wrote: Show quoted text
> Not sure if this is a bug, or only a documentation issue, but I > noticed a slight inconsistency of behaviour when creating a > NetAddr::IP object with an empty string and/or undef address. > > # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP-
> >new(undef,"255.255.255.0")'
> 4.075 > 0.0.0.0/24 > > # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP-
> >new("","255.255.255.0")'
> 4.075 > > > On an older version (4.027) supplying undef, or empty string makes no > difference, and always returns undef > > # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP-
> >new(undef,"255.255.255.0")'
> 4.027 > > # perl -MNetAddr::IP -E 'say $NetAddr::IP::VERSION;say NetAddr::IP-
> >new("","255.255.255.0")'
> 4.027 > > I guess that this issue is related to #75976