Re: Class::DBI modules not properly loaded under mod_perl

[prev] [thread] [next] [Date index for 2004/10/22]

From: Michele Valzelli
Subject: Re: Class::DBI modules not properly loaded under mod_perl
Date: 12:47 on 22 Oct 2004
On Fri, 22 Oct 2004 colm-cdbi@xxxxxxxxx.xx.xx wrote:

> On Fri, Oct 22, 2004 at 12:55:23PM +0200, Michele Valzelli wrote:
> > 
> > package MyClass::Bar;
> > 
> > ....
> > 
> > __PACKAGE__->has_a(foo => 'MyClass::Foo');
> > 
> > ...
> > 
> > sub test {
> >   my $self = shift;
> > 
> >   if ($self->foo == 1) {
> > 	return 1;
> >   } else { 
> > 	return 0;
> >   }
> > }
> > 
> > 
> > Any coll to $bar->test works 99.9% of the times, but sporadically I get 
> > this kind of error:
> > 
> > Operation `==': no method found, left argument in overloaded package 
> > MyClass::Foo, right argument has no overloaded magic
> 
> I'm probably not following it properly (if it works 99% of the time) but
> did you really mean to test that '$self->foo == 1' (since it is a
> MyClass::Foo object)?  Perhaps you wanted to test that it was defined
> or that $self->foo->id == 1?

I wanto to test that $self->foo->id == 1. Reading through the OVERLOADED 
OPERATORS section of the docs I understant that '$self->foo == 1' isn't 
the same thing as '$self->foo->id == 1'. But I get this error on different 
tables also with tests like $self->foo eq 'baz' (of course in this case 
the id of Foo is a string). It seems that sometimes operators don't get 
overloaded for all modules.

        -- 
        Michele Valzelli - Messagenet srl
Messaggistica e Telecomunicazioni
Tel: +39 02 48102000
Fax: +39 02 700443128

(message missing)

pager
David R. Baird 09:48 on 20 Oct 2004

Re: pager
David R. Baird 13:53 on 20 Oct 2004

Re: pager
David R. Baird 21:00 on 20 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 02:55 on 21 Oct 2004

Re: pager
David R. Baird 10:46 on 21 Oct 2004

Re: pager
David R. Baird 11:30 on 21 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 12:10 on 21 Oct 2004

Re: pager
David R. Baird 23:08 on 21 Oct 2004

Re: pager
Cees Hek 00:22 on 22 Oct 2004

Re: pager
Tony Bowden 08:34 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 13:51 on 22 Oct 2004

Re: pager
David R. Baird 14:41 on 22 Oct 2004

Re: pager
David R. Baird 09:20 on 22 Oct 2004

Class::DBI modules not properly loaded under mod_perl ?
Michele Valzelli 10:55 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 12:21 on 22 Oct 2004

Re: pager
David R. Baird 12:52 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 15:33 on 22 Oct 2004

Re: pager
David R. Baird 16:09 on 22 Oct 2004

Re: pager
David R. Baird 23:30 on 07 Nov 2004

RE: pager
Emanuele Zeppieri 03:50 on 14 Nov 2004

Re: Class::DBI modules not properly loaded under mod_perl
Michele Valzelli 12:47 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 13:25 on 22 Oct 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52