Re: Overload error -- Operation `eq': no method found
[prev]
[thread]
[next]
[Date index for 2005/04/28]
I have seen that error many times myself, and I have never quite been
able to track down the exact cause. I suspect it is down in overload.pm.
My workaround has always been, as Matt suggested, never to compare
objects when I mean to compare their stringification or their ID (which
are not necessarily the same).
Hope that helps. If anyone can narrow down the cause of this better,
speak up. :)
-Vince
Matt S Trout wrote:
>On Thu, Apr 28, 2005 at 01:10:41PM -0400, Juan Camacho wrote:
>
>
>>This is a shot in the dark, but I wonder if anyone has come across an
>>error like this under a mod_perl environment. I'm unable to duplicate
>>outside of our production environment, which makes this quite hard to
>>track.
>>
>>Operation `eq': no method found,
>> left argument in overloaded package Onyx::DB::RTMType,
>> right argument in overloaded package Onyx::DB::RTMType
>>
>>
>>The code the produces it is something like this:
>> my $type = $rtm->rtm_type;
>> my $current_type = $current_rtm->rtm_type;
>> return 1 if $type eq $current_type;
>>
>> # RTM has_a RTMType;
>>
>>We are running CDBI version 0.95, Apache/1.3.27 (Unix) mod_perl/1.27
>>
>>Even wild guesses are welcome :)
>>
>>
>
>Something's gone wrong in the stringification somewhere, I'd guess.
>
>How about
>
>return 1 if $type->id == $current_type->id; # assuming numeric pk
>
>instead?
>
>
>