sub new {
my ($class, $r) = @_;
return bless { r = Apache::Request-new($r),
}, $class;
}
or
sub new {
my ($class,$r) = @_;
my $self = $class-SUPER::new($r);
# do your own init ...
return $self
}
TMTOWTDI, aaron
--
aaron
Paul Lindner wrote:
If you look you'll see that the new() method is written in C. It
should be blessing itself into the passed in class, not using
Apache::Request.
You're right- except that this is exactly how the Apache class,
from which Apache::Request is derived, expects to be
I am slowly learning about OO from Tom's tutorial, and was able to do inheritance with
two dummy classes I wrote, including adding methods to the subclass and have them work
too. However, when I tried to inherit from Apache::Request, it doesn't seem to work
right. Maybe this isn't an
Alex Porras wrote:
I am slowly learning about OO from Tom's tutorial, and was able to do inheritance
with two dummy classes I wrote, including adding methods to the subclass and have
them work too. However, when I tried to inherit from Apache::Request, it doesn't
seem to work right. Maybe
at using the universal isa and can methods while
you're debugging and trying stuff out. Good luck!
Wes Sheldahl
Alex Porras [EMAIL PROTECTED] on 02/14/2002 01:44:20 PM
To: mod perl list [EMAIL PROTECTED]
cc:(bcc: Wesley Sheldahl/Lex/Lexmark)
Subject: inheritance and Apache::Request
I
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
On Thu, Feb 14, 2002 at 01:55:34PM -0600, Alex Porras wrote:
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