Subject: | Numeric inequality overloading is wrong |
The overloading for != is incorrect, it's actually testing equality rather than inequality.
This is illustrated with the following code:
use constant::Atom qw(happy sad indifferent);
my $mood = happy;
if ($mood != happy) {
print "mood isn't happy :-(\n";
} else {
print "mood is happy :-)\n";
}
Which should print "mood is happy", but it doesn't, it prints "mood isn't happy".
I've fixed this and added a test to the testsuite to confirm. My fixed version is on github:
https://github.com/neilbowers/constant-Atom
Happy to do a release if you want to give me co-maint.