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