In much of my code I do things like:
if ($element1 == $element2) {
...
}
Overloading hash deref seems to have broken this approach. It's not
clear that this was ever officially supported - there's no test case
for it - but it seemed to work. Now it doesn't. Mea culpa.
Anyway, this fixes it:
package XML::LibXML::Element;
use Scalar::Util qw/blessed/;
use overload 'eq' => '_isSameNodeLax', '==' => '_isSameNodeLax';
sub _isSameNodeLax
{
my ($self, $other) = @_;
if (UNIVERSAL::can($other, 'isa')
and $other->isa('XML::LibXML::Element'))
{
return $self->isSameNode($other);
}
return;
}