perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Porras" <apor...@ena.com>
Subject inheritance and Apache::Request
Date Thu, 14 Feb 2002 18:44:20 GMT
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 Apache::Request issue, so forgive me if that's the case, but here's what I got:

FooBar.pm
---------------------------------------------
package FooBar;

use strict;
use Apache::Request();

@FooBar::ISA = qw(Apache::Request);

sub fooey {
	print "hello world, I'm in FooBar";
}

---------------------------------------------

Handler.pm
---------------------------------------------
sub handler {
	my $r = shift;
 	$r->send_http_header('text/html');
	my $form = FooBar->new($r);
	$form->fooey;
	$r->exit(OK);
}


Here's the error I get:

[Thu Feb 14 12:35:14 2002] [error] Can't locate object method "fooey" via package "Apache::Request"
(perhaps you forgot to load "Apache::Request"?) at /path/modified/Handler.pm line 21.



Mime
View raw message