Re: inheritance and Apache::Request

2002-02-15 Thread Joe Schaefer
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 subcl

Re: inheritance and Apache::Request

2002-02-15 Thread Aaron Ross
> > 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 -

Re: inheritance and Apache::Request

2002-02-14 Thread Paul Lindner
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

RE: inheritance and Apache::Request

2002-02-14 Thread Alex Porras
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

Re: inheritance and Apache::Request

2002-02-14 Thread wsheldah
Hi Alex, 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" met

Re: inheritance and Apache::Request

2002-02-14 Thread Geoffrey Young
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. M