Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: pause [...] erichacker.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 3.33
  • 4.004
Fixed in: (no value)



Subject: Operator eq works, but ne crashes.
Example: use NetAddr::IP; my $ip = NetAddr::IP->new('localhost'); if ($ip ne '') { print "Didn't die! \n"; } This will die with -noxs. Tested on Activestate Build 718 v5.8.8 on WindowsXP, where I do not have a C compiler installed, and OpenBSD 3.9 v5.8.6 where 4.004 would not compile with xs code. It is not intuitive that eq would work and ne would not. This could be a documentation bug or a code bug, but I really think if you overload eq then ne should work as well. In my particular case, I was looping over a hash, manipulating values and trying to skip the empty ones. I do not know if I'm testing a NetAddr:IP object and probably do not use any other objects overloaded so well. Thanks for the handy IP manipulation capabilities.
ne operator is not overloaded != operator is not overloaded This has not changed from previous versions. from the POD You can test for equality with either "eq" or "==". Comparison via >, <, >=, <=, <=> and ""cmp"" What you get with 'eq' and '!=' is whatever perl does with the two arguments. Please see the documentation for NetAddr::IP and NetAddr::IP::Lite
ne operator is not overloaded != operator is not overloaded This has not changed from previous versions. from the POD You can test for equality with either "eq" or "==". Comparison via >, <, >=, <=, <=> and ""cmp"" What you get with 'eq' and '!=' is whatever perl does with the two arguments. Please see the documentation for NetAddr::IP and NetAddr::IP::Lite