[Maypole] Error: Can't fetch data as class method ??

Perrin Harkins perrin@elem.com
Wed, 27 Oct 2004 16:58:33 -0400


On Wed, 2004-10-27 at 16:03, Peter Speltz wrote:
> >Presumably this is because you were calling something
> > higher up the chain as an object method before and are now calling it as
> > a class method.
> 
> Excuse my ignorance but, 
> Could you explain this a little more?  I'm cofused a little why it matters if
> it calls it as a class method or an object method. This sub just returns a hash
> ref.

I could be wrong about the reason for the message, especially since I've
never used Class::DBI::AsForm, but if you don't understand the
differences between class and object methods in perl you definitely need
to re-read the OO man pages.  It's very significant.

> I'm starting to think it may have something to do with the subtlties of
> references. Like maybe saying  IF (Class->has_a_new) won't work but saying If
> ($obj->has_a_new) will work.  Am i getting warmer?

Yes, when you call Class->has_a_new() it sends a class name and when you
call $obj->has_a_new() it sends a reference to a specific object.

> or maybe i need a "no strict 'refs' statement somewhere?  

No, that's not going to help.

- Perrin