[Templates] Template::Stash::_dotop hates me

Andy Wardley abw@wardley.org
Wed, 14 Mar 2007 19:16:13 +0000


Randal L. Schwartz wrote:
> Well, not just me: it hates anything that has overloaded magic.
> 
> Here's my fix:
[...]
> -    my $atroot  = ($root eq $self);
> +    my $atroot  = eval { $root->isa(ref $self) } && ($root eq $self);

I think the following should suffice.

        my $atroot  = (ref $root && "$root" eq $self);

Stringifying $root should stamp out any overloaded comparison operator.

Unless anyone has a good reason why not?

A