perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Porras" <apor...@ena.com>
Subject RE: inheritance and Apache::Request
Date Thu, 14 Feb 2002 19:55:34 GMT
Ok, that makes sense.  But the reason I didn't include a "new" method for FooBar was because
I don't know what A::R's "new" method does, so I didn't want to override it.  What if it does
some init stuff to the object? I'm assuming that's what's happening because, after adding
a "new" method to FooBar, when I try to call $foobar->param (which I have not overridden),
the child process segfaults.  Oh well, I guess at this point I need to go back to reading
more on perl OO since it's not sinking.

Thanks for your help!

--Alex

> -----Original Message-----
> From: wsheldah@lexmark.com [mailto:wsheldah@lexmark.com]
> 
> The problem is that package FooBar doesn't have a "new" 
> method. Here's what happened as a result.
> 
> When you called 'FooBar->new($r), perl looked for a sub 
> called "new" in package
> FooBar. Since it didn't find one, it looked at FooBar's @ISA, 
> and looked in
> Apache::Request for a "new" method. There it presumably found 
> one, so that
> statement didn't return an error. But, the new() in 
> Apache::Request probably
> returned an Apache::Request object instead of a FooBar 
> object, so when you
> called "$form->fooey", it only looked in Apache::Request and 
> any modules in it's
> @ISA.
> 
> You might want to look at using the universal "isa" and "can" 
> methods while
> you're debugging and trying stuff out. Good luck!
> 
> Wes Sheldahl

Mime
View raw message