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

Randal L. Schwartz merlyn@stonehenge.com
Wed, 14 Mar 2007 13:03:26 -0700


>>>>> "Andy" == Andy Wardley <abw@wardley.org> writes:

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

Andy> I think the following should suffice.

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

Andy> Stringifying $root should stamp out any overloaded comparison operator.

Yeah, that might work.  Hmm, I wonder if q{""} can return a blessed
object? :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!