[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Superclass question (new to OO)


Mark Fuller wrote:
The problem is, when I reference the logging method (which is in myApp.pm)
from anywhere (as $self->loging(), or as "$object->loggin() in the lowest
level cgi-bin script") it fails with "undefined subroutine."

Are you actually attempting to access the logging() method from the CGI script? Or do you mean attempting to access it in object.pm? If you're attempting to access it from the CGI script, it strikes me as a messy, messy thing that you are trying to do. I'm not sure if that would work.

From what you've shown, however, I'm not _seeing_ why a call to your logging() method should fail in object.pm. I would think that a simple $self->logging() call would work.

That being said, I've never attempted that level multiple inheritance. But I don't think it should matter.

Some things for you to try however:
- In your base class, have one of your other methods call your logging routine. Does it work? - If so, have one of your methods in myApp.pm call the logging method. Does it still work? - If so, try again in object.pm. Try to establish a set of circumstances that cause your logging function to break (or not get called).

An automated test suite for your application might help you find these types of things. Perl Monks has some nodes that might help get you started there.

Hope this was of some help. I don't feel like I answered your questions all that well, but hopefully you have a place to get started from.

Good luck!
Jason A. Crome

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.